简体   繁体   中英

How to get MIME type of a text file without extension in Node.js

How can I get MIME type of a text file with no extension in Node.js? I am using file-type package, but it does not detect file type of text files. Thanks

Without a helper package, you can't easily tell of which format is a certain text file. There just isn't a place where different file formats say who they are; you would have to use a bunch of regexes, one for each file format.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM