mime
Simple mime type library. Can be used standalone or as a module for the allegiant app framework.
There be 🐲 here! The API and functionality are being cemented, anything before a 1.0.0 release is subject to change.
Installation
npm install @allegiant/mime --save
Usage
const Mime = require('@allegiant/mime');
var mime = new Mime();
console.log("Default Mime Type: ", mime.type());
console.log("Mime type for: .txt", "-", mime.type(".txt"));
console.log("Alternative extension: txt", "-", mime.type("txt"));
console.log("Content-Type:", mime.type(".txt", 'utf8'));
console.log("Known extensions for Mime Type: 'text/html' =", mime.ext("text/html"));
console.log("Extensions for Unknown Mime Type: 'unknowntype' = '" + mime.ext("unknowntype") + "'");
Copyright & License
Copyright © 2017 Allegiant. Distributed under the terms of the MIT License, see LICENSE
Availble via npm or github.