How to use file-icon - 2 common examples

To help you get started, we’ve selected a few file-icon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / file-icon-cli / cli.js View on Github external
(async () => {
	const icon = await fileIcon.buffer(cli.input[0], {
		size: cli.flags.size,
		destination
	});

	if (process.stdout.isTTY || process.env.__FILE_ICON_SHOULD_NOT_PIPE__) {
		console.log(destination);
	} else {
		process.stdout.write(icon);
	}
})();
github wulkano / kap / main / utils / icon.js View on Github external
const getAppIcon = async () => {
  const buffer = await fileIcon.buffer(process.pid);
  return buffer.toString('base64');
};

file-icon

Get the icon of a file or app as a PNG image (macOS)

MIT
Latest version published 1 year ago

Package Health Score

52 / 100
Full package analysis

Popular file-icon functions