How to use the ext-name.mime function in ext-name

To help you get started, we’ve selected a few ext-name 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 cutls / TheDesk / app / node_modules / electron-dl / index.js View on Github external
function getFilenameFromMime(name, mime) {
	const exts = extName.mime(mime);

	if (exts.length !== 1) {
		return name;
	}

	return `${name}.${exts[0].ext}`;
}
github bottos-project / data_exchange / src / sys_modules / BTElectron-dl / BTElectron-dl0.js View on Github external
function getFilenameFromMime(name, mime) {
	const exts = extName.mime(mime);

	if (exts.length !== 1) {
		return name;
	}

	return `${name}.${exts[0].ext}`;
}
github sindresorhus / electron-dl / index.js View on Github external
function getFilenameFromMime(name, mime) {
	const exts = extName.mime(mime);

	if (exts.length !== 1) {
		return name;
	}

	return `${name}.${exts[0].ext}`;
}
github kevva / download / index.js View on Github external
const getExtFromMime = res => {
	const header = res.headers['content-type'];

	if (!header) {
		return null;
	}

	const exts = extName.mime(header);

	if (exts.length !== 1) {
		return null;
	}

	return exts[0].ext;
};

ext-name

Get the file extension and MIME type from a file

MIT
Latest version published 7 years ago

Package Health Score

65 / 100
Full package analysis

Popular ext-name functions