mime-types
Get MIME type based on file name.
Installation
In the Node.js environment, you can install directly using NPM:
$ npm i @litert/mime-types --save
Or install the developing (unstable) version for newest features:
$ npm i @litert/mime-types@dev --save
API
Demo code is written using TypeScript.
import * as mime from "@litert/mime-types";
mime.get("hello.json"); // application/json
mime.get(".html"); // text/html
mime.get("css"); // text/css
mime.get("hi/baby.js"); // application/javascript
mime.get("/root/down/pk.zip"); // application/zip
mime.get("ext.dodooh"); // application/octet-stream
License
This library is published under Apache-2.0 license.