{"_id":"mimetype","_rev":"22-0d2fd637abfcb2818bff2b8b710dc445","name":"mimetype","description":"A mime type catalog driven by filename extensions.","dist-tags":{"latest":"0.0.8"},"versions":{"0.0.3":{"name":"mimetype","version":"0.0.3","description":"A mime type catalog driven by filename extensions.","main":"./mimetype.js","repository":{"type":"git","url":"https://github.com/rsdoiel/mimetype-js.git"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"engines":{"node":">= 0.8","npm":">= 1"},"dependencies":{},"scripts":{"test":"node mimetype_test.js"},"bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"_id":"mimetype@0.0.3","dist":{"shasum":"488cc24f62fe8bc2e472e66ae52d451a638ccdd1","tarball":"https://registry.npmjs.org/mimetype/-/mimetype-0.0.3.tgz","integrity":"sha512-dVNOk27MDv85pxfZQRS1+Ox8IFd1YarvzYHokMm9pgUIRc6zJIDMPqzE7Y9xhrUaSbn9/gYfJcpfT37yPi5sfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCBNnPbIPnnMwOUY6s4yw5FBboH2d84L25+hoXkvt5JoQIgJht5ELiS2cjjCsJwtfzA+ydHSNdXRmQycr7oEjXPMr4="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"rsdoiel","email":"rsdoiel@gmail.com"},"directories":{}},"0.0.4":{"name":"mimetype","version":"0.0.4","description":"A mime type catalog driven by filename extensions.","main":"./mimetype.js","repository":{"type":"git","url":"https://github.com/rsdoiel/mimetype-js.git"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"engines":{"node":">= 0.8","npm":">= 1"},"dependencies":{"harness":">= 0.0.2"},"scripts":{"test":"node tests/mimetype_test.js"},"bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"_id":"mimetype@0.0.4","dist":{"shasum":"2847b4595b9be3765317e0df5d2254fa97545dcb","tarball":"https://registry.npmjs.org/mimetype/-/mimetype-0.0.4.tgz","integrity":"sha512-IUkBonAa85sUBOUy+cWgp158zk3qyDpRmaO5viVTle8IiZwWgZSa5nludI/EE4z1QgWxiAGmtg43v4WJzbbThg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCZnHKMkjKbFmBGosncHB/hcy2X6B3jjMgnKGlcvKsRwgIgQ4fQSCJEC/vakA6ENqZK+CqbjWDGcHEhZDIXiS1iUug="}]},"_npmVersion":"1.1.62","_npmUser":{"name":"rsdoiel","email":"rsdoiel@gmail.com"},"directories":{}},"0.0.5":{"name":"mimetype","version":"0.0.5","description":"A mime type catalog driven by filename extensions.","main":"./mimetype.js","repository":{"type":"git","url":"https://github.com/rsdoiel/mimetype-js.git"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"engines":{"node":">= 0.8","npm":">= 1"},"devDependencies":{"yui":"3.10.x"},"scripts":{"test":"node tests/mimetype_test.js"},"bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"_id":"mimetype@0.0.5","dist":{"shasum":"9cb586acfdd3ef08792eb8051de8b4fc3d7ed575","tarball":"https://registry.npmjs.org/mimetype/-/mimetype-0.0.5.tgz","integrity":"sha512-Atl7tw4TuLkimKDrbhkvjEssp0Ijb8ccMZ65/sSxVOKJOlxMJZbWs3qyqXR3/lNxWfd2adZDrPMAIKhcW684ew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIXkj/gJHdr9oiDcZmSMZNzeecCxq/JBlOa2BessBYcwIhANh+w4wB7OwMvW4CBQhSZkICmaJtryJliHa9tuGX9vQ+"}]},"_from":".","_npmVersion":"1.2.24","_npmUser":{"name":"rsdoiel","email":"rsdoiel@gmail.com"}},"0.0.6":{"name":"mimetype","version":"0.0.6","description":"A mime type catalog driven by filename extensions.","main":"./mimetype.js","repository":{"type":"git","url":"https://github.com/rsdoiel/mimetype-js.git"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"engines":{"node":">= 0.8","npm":">= 1"},"devDependencies":{"yui":"3.10.x"},"scripts":{"test":"node tests/mimetype_test.js"},"bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"gitHead":"b0eeb8ca64c83f96eaf429e24df52f686a9b6da8","homepage":"https://github.com/rsdoiel/mimetype-js","_id":"mimetype@0.0.6","_shasum":"9c2abfe311466fcb2247208d0304b8b2f5836e97","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"rsdoiel","email":"rsdoiel@gmail.com"},"dist":{"shasum":"9c2abfe311466fcb2247208d0304b8b2f5836e97","tarball":"https://registry.npmjs.org/mimetype/-/mimetype-0.0.6.tgz","integrity":"sha512-IZHATZaB4g6VsG1QrGqjQzgwQVvjUEK8W78TR8rZKofvlEZiIUxUthPql1Dw22x9J+4iyWWg7UBsiEK64v7V7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICFyTb4f30+zy1awOs1d7vKMTkSXJvihCN4Wn/LpQYerAiEA1rZnarwa095PlrisKszGn0C0X+loQF4/3L/5uufMXB0="}]}},"0.0.7":{"name":"mimetype","version":"0.0.7","description":"A mime type catalog driven by filename extensions.","main":"./mimetype.js","repository":{"type":"git","url":"https://github.com/rsdoiel/mimetype-js.git"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"engines":{"node":">= 0.8","npm":">= 1"},"devDependencies":{"yui":"3.10.x"},"scripts":{"test":"node tests/mimetype_test.js"},"bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"gitHead":"f7635736a76639599e2dfd66a6cee7b314324ecb","homepage":"https://github.com/rsdoiel/mimetype-js","_id":"mimetype@0.0.7","_shasum":"a6b51a799e23d0b8ddb18d5e8258c958656e2478","_from":".","_npmVersion":"2.5.1","_nodeVersion":"0.12.0","_npmUser":{"name":"rsdoiel","email":"rsdoiel@gmail.com"},"dist":{"shasum":"a6b51a799e23d0b8ddb18d5e8258c958656e2478","tarball":"https://registry.npmjs.org/mimetype/-/mimetype-0.0.7.tgz","integrity":"sha512-qkBGF249x6+WLg0hb42577yjroRESRfR7cUYwd4L+ZyMcNMNFWzHLCdYpsZvWSH8/d8aIJpyZjox6AGKEgfFJA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCmEOfma/UAKge2c5Lq70SwQDMDlZUyrcYeHoJj7Z6jwgIgXyuUvNAeoADdPoZNpSUMwszxhwx7fXbcU2OrlaIiG8E="}]}},"0.0.8":{"name":"mimetype","version":"0.0.8","description":"A mime type catalog driven by filename extensions.","license":"BSD-2-Clause","main":"./mimetype.js","repository":{"type":"git","url":"git+https://github.com/rsdoiel/mimetype-js.git"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"engines":{"node":">= 0.8","npm":">= 1"},"devDependencies":{"yui":"3.10.x"},"scripts":{"test":"node tests/mimetype_test.js"},"bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"gitHead":"7c58fcb78f752f98dcd9f332c439af2ff2cdea8a","homepage":"https://github.com/rsdoiel/mimetype-js#readme","_id":"mimetype@0.0.8","_shasum":"fb30022794bbf7725cb7b46df820e87dd91fd086","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"rsdoiel","email":"rsdoiel@gmail.com"},"dist":{"shasum":"fb30022794bbf7725cb7b46df820e87dd91fd086","tarball":"https://registry.npmjs.org/mimetype/-/mimetype-0.0.8.tgz","integrity":"sha512-6pRFUMC9A70v3W1d+dvrEJWuFagmHSIA6JF1rd3dkiEe9myrQUQMK1AUjKfrqGtpQww5Wk/mRBJHmIdn140NhA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBfmHK4w6XGjd9VbZL422i5OwChza5Gw8Pl6PS3cZvMgIhALrVUZQ77UNFMuD0nLcja7TLUs5bOY1rj4OwsHrRW0e1"}]}}},"readme":"[![build status](https://secure.travis-ci.org/rsdoiel/mimetype-js.png)](http://travis-ci.org/rsdoiel/mimetype-js)\nmimetype-js\n===========\n\n# Overview\n\nI find keep making these file extension lookup tables for mime types.  It's \nabout time I put it in a module to save me the trouble.\n\n# Examples\n\n## general case\n\n```JavaScript\n\tvar mimetype = require('mimetype');\n\t\n\tconsole.log(mimetype.lookup(\"myfile.txt\")); // Should display text/plain\n\tmimetype.set('.exotic', 'x-application/experimental'); // Add/update a mime type in the catalog\n\tconsole.log(mimetype.lookup(\"myfile.exotic\")); // Should display x-application/experimental\n\tmimetype.del('.exotic'); // Removes the mime type from the catalog\n\tconsole.log(mimetype.lookup(\"myfile.exitoc\")); // Should display false\n\tmimetype.forEach(function (ext, mime_type_string) {\n\t\tconsole.log(ext, mime_type_string); // Display the extension and matching mimetype in catalog\n\t});\n```\n\n## Special cases\n\nSometimes detecting by filename extensions isn't work and you want to \ndefault to a general purposes mime-type (e.g. text/plain, application/octet-stream).\n\n```JavaScript\n\tvar mimetype = require('mimetype');\n\t\n\t// This should display 0 (false)\n\tconsole.log(mimetype.lookup(\"filename.unknownMimeType\");\n\t// This should display the string text/plain\n\tconsole.log(mimetype.lookup(\"filename.unknownMimeType\", false, \"text/plain\");\n\t// This should display the string text/plain; charset=UTF-8\n\tconsole.log(mimetype.lookup(\"filename.unknownMimeType\", \"UTF-8\", \"text/plain\");\n```\n\n## Using mimetype.js with MongoDB Shell\n\nWhile this was implemented as a NodeJS module it also works under MongoDB's shell.\nInstead of including with a \"require\" you would load the JavaScript file _load-mimetype.js_.\n\n```JavaScript\n\tload(\"./extras/load-mimetype.js\");\n\tprint(\"Check the mime type of test.txt:\" + MimeType.lookup(\"test.txt\"));\n```\n\nThis would display something like-\n\n```shell\n\tMongoDB shell version: 2.2.0\n\tconnecting to: test\n\t> load(\"./extras/load-mimetype.js\");\n\t> print(\"Check the mime type of test.txt: \" + MimeType.lookup(\"test.txt\"));\n\tCheck the mime type of test.txt: text/plain\n\t> \n```\n","maintainers":[{"name":"rsdoiel","email":"rsdoiel@gmail.com"}],"time":{"modified":"2022-06-19T19:58:06.337Z","created":"2012-04-17T17:07:46.493Z","0.0.1":"2012-04-17T17:07:47.607Z","0.0.2":"2012-04-20T18:07:30.281Z","0.0.3":"2012-09-13T14:51:18.670Z","0.0.4":"2012-10-08T18:43:31.102Z","0.0.5":"2013-06-02T18:30:16.192Z","0.0.6":"2015-01-29T18:21:20.999Z","0.0.7":"2015-03-24T17:41:46.496Z","0.0.8":"2015-11-17T21:19:42.945Z"},"author":{"name":"R. S. Doiel","email":"rsdoiel@gmail.com","url":"https://github.com/rsdoiel"},"repository":{"type":"git","url":"git+https://github.com/rsdoiel/mimetype-js.git"},"homepage":"https://github.com/rsdoiel/mimetype-js#readme","bugs":{"url":"http://github.com/rsdoiel/mimetype-js/issues"},"readmeFilename":"README.md","users":{"siyb":true},"license":"BSD-2-Clause"}