file-uti

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

Usage no npm install needed!

<script type="module">
  import fileUti from 'https://cdn.skypack.dev/file-uti';
</script>

README

file-uti

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

Install

$ npm install file-uti

Usage

import {fileUti} from 'file-uti';

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

API

fileUti(filePath)

Returns a Promise<string> with the UTI.

fileUtiSync(filePath)

Returns a string with the UTI.

Related