mime-db
mime-db copied to clipboard
Add log files support
Can you give us more information about this MIME?
I apologize for the wait.
.log files are associated with text/x-log if the file implements Express.Multer.File (express, nest.js file handler)
and text/plain if
file --mime-type -b test.log
# output will be text/plain and inode/x-empty if file is empty
or
import path from 'path';
import mime from 'mime-types';
const ext = path.extname('./test.log');
const mimetype = mime.lookup(ext);
console.log(ext, mimetype);