Comprehensive MIME type mapping API based on mime-db module.
This is a fork of node-mime from Robert Kieffer (broofa).
I removed the file-system dependency to be able to use it within the browser and other system.
Added a prioritization of non
???/x-??? mime types to fulfill the tests.
Install with npm:
npm install mime-nofs
Contributing / Testing
npm run test
API - Queries
Get the mime type associated with a file, if no mime type is found
application/octet-stream is returned. Performs a case-insensitive lookup using the extension in
path (the substring after the last '/' or '.'). E.g.
var mime = ;mime; // => 'text/plain'mime; // => 'text/plain'mime; // => 'text/plain'mime; // => 'text/html'
Sets the mime type returned when
mime.lookup fails to find the extension searched for. (Default is
Get the default extension for
mime; // => 'html'mime; // => 'bin'
Map mime-type to charset
mimecharsets; // => 'UTF-8'
(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)
API - Defining Custom Types
Custom type mappings can be added on a per-project basis via the following APIs.
Add custom mime/extension mappings
mime;mime; // => 'text/x-some-format'
The first entry in the extensions array is returned by
mime; // => 'x-sf'
|2.0.0||2015-11-06||initial fork from (node-mime 1.3.4)[https://github.com/broofa/node-mime/releases/tag/v1.3.4]; Changed build to js file; Removed
|aws-s3-form||Generate a signed and ready to use formdata to put files to s3 directly from the browser. Signing is done by using AWS Signature Version 4|
|node-cache||Simple and fast NodeJS internal caching. Node internal in memory cache like memcached.|
|domel||A simple dom helper if you want to get rid of jQuery|
|backlunr||A solution to bring Backbone Collections together with the browser fulltext search engine Lunr.js|
|obj-schema||Simple module to validate an object by a predefined schema|
|rsmq||A really simple message queue based on Redis|
|rsmq-cli||a terminal client for rsmq|
|rest-rsmq||REST interface for.|
|redis-notifications||A redis based notification engine. It implements the rsmq-worker to safely create notifications and recurring reports.|
|redis-sessions||An advanced session store for NodeJS and Redis|
|connect-redis-sessions||A connect or express middleware to simply use the redis sessions. With redis sessions you can handle multiple sessions per user_id.|
|systemhealth||Node module to run simple custom checks for your machine or it's connections. It will use redis-heartbeat to send the current state to redis.|
|task-queue-worker||A powerful tool for background processing of tasks that are run by making standard http requests.|
|soyer||Soyer is small lib for serverside use of Google Closure Templates with node.js.|
|grunt-soy-compile||Compile Goggle Closure Templates ( SOY ) templates inclding the handling of XLIFF language files.|
The MIT License (MIT)
Copyright © 2015 M. Peter
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.