node fs filetype code example
Example: File type node js
const FileType = require('file-type');
(async () => {
console.log(await FileType.fromFile('Unicorn.png'));
//=> {ext: 'png', mime: 'image/png'}
})();
const FileType = require('file-type');
(async () => {
console.log(await FileType.fromFile('Unicorn.png'));
//=> {ext: 'png', mime: 'image/png'}
})();