npm install file-type
与:
}
const filename = 'path/to/your/file'; getFileType(filename) .then((result) => console.log('MIME type:', result)) .catch((err) => console.error('Error:', err));