Usage of mime-types is fairly straightforward after you've installed it using the npm install command
var mime = require('mime-types'). The various functions provide different use cases:
mime.lookup('json'); //returns 'application/json'
mime.contentType('markdown'); //returns 'text/x-markdown; charset=utf-8'
mime.extension('application/octet-stream'); //returns 'bin'
mime.charset('text/markdown'); //returns 'UTF-8'
mime.types[extension]and a map of extensions by content-type at
Mime-types documentation can be found on the project's GitHub page at
https://github.com/jshttp/mime-types. The readme file on the project's GitHub page offers detailed understanding of mime-types, covering different aspects like installation, usage and API. It should be your go-to guide for any queries regarding the usage of this package.