All Projects → sindresorhus → File Uti

sindresorhus / File Uti

Licence: mit
Get the UTI (Uniform Type Identifier) of a file on macOS

Programming Languages

javascript
184084 projects - #8 most used programming language

file-uti Build Status

Get the UTI (Uniform Type Identifier) of a file on macOS

Install

$ npm install file-uti

Usage

const fileUti = require('file-uti');

(async () => {
	console.log(await fileUti('index.js'));
	//=> 'com.netscape.javascript-source'
})();

API

fileUti(filePath)

Returns a Promise<string> with the UTI.

fileUti.sync(filePath)

Returns a string with the UTI.

Related

License

MIT © Sindre Sorhus

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].