{"_id":"mime-lookup","_rev":"5-ddb2ad06f0fe0d2acf89d7eb7c04799b","name":"mime-lookup","description":"A utility library for dealing with mime-types","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"mime-lookup","version":"0.0.1","description":"A utility library for dealing with mime-types","main":"mime-lookup.js","directories":{"test":"test"},"scripts":{"test":"node test/test.js"},"repository":{"type":"git","url":"git+https://github.com/Hypercubed/mime-lookup.git"},"keywords":["util","mime"],"author":{"name":"J. Harshbarger"},"contributors":[{"name":"Benjamin Thomas","email":"benjamin@benjaminthomas.org","url":"http://github.com/bentomas"},{"name":"Robert Kieffer","email":"robert@broofa.com","url":"http://github.com/broofa"}],"license":"MIT","bugs":{"url":"https://github.com/Hypercubed/mime-lookup/issues"},"homepage":"https://github.com/Hypercubed/mime-lookup#readme","devDependencies":{"mime-db":"^1.18.0"},"gitHead":"208dc98fff2c99533cdc9949a827b78438f3a478","_id":"mime-lookup@0.0.1","_shasum":"85ba1eb130d6a76ba1e3d85571d1b09e7bb266b6","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"hypercubed","email":"hypercubed@gmail.com"},"dist":{"shasum":"85ba1eb130d6a76ba1e3d85571d1b09e7bb266b6","tarball":"https://registry.npmjs.org/mime-lookup/-/mime-lookup-0.0.1.tgz","integrity":"sha512-gvCffAlgMRt3CSRs4WyuBSM+eij+Ebo2/ZC654yvZNCBzOjFSmnh9tcLAyaRslyQOlxN+3LEe95PO423RGEldw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUDIvLgNrIWcNd8YUlDTHf5YoXtFjh/lTOMaTuaDjuRAIhALnQYZFYraDa7zwfsPqkzB7N7InnjUkahktt68hRnsP5"}]},"maintainers":[{"name":"hypercubed","email":"hypercubed@gmail.com"}]},"0.0.2":{"name":"mime-lookup","version":"0.0.2","description":"A utility library for dealing with mime-types","main":"mime-lookup.js","directories":{"test":"test"},"scripts":{"test":"node test/test.js"},"repository":{"type":"git","url":"git+https://github.com/Hypercubed/mime-lookup.git"},"keywords":["util","mime"],"author":{"name":"J. Harshbarger"},"contributors":[{"name":"Benjamin Thomas","email":"benjamin@benjaminthomas.org","url":"http://github.com/bentomas"},{"name":"Robert Kieffer","email":"robert@broofa.com","url":"http://github.com/broofa"}],"license":"MIT","bugs":{"url":"https://github.com/Hypercubed/mime-lookup/issues"},"homepage":"https://github.com/Hypercubed/mime-lookup#readme","devDependencies":{"mime-db":"^1.18.0"},"gitHead":"02d05673e3dcc60f1b11a6b02e0c9b76286dbf20","_id":"mime-lookup@0.0.2","_shasum":"a3525d262c42e4cada585991f850038a5d5d241d","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"hypercubed","email":"hypercubed@gmail.com"},"dist":{"shasum":"a3525d262c42e4cada585991f850038a5d5d241d","tarball":"https://registry.npmjs.org/mime-lookup/-/mime-lookup-0.0.2.tgz","integrity":"sha512-6384dzMc9tsk9wBt/W9jG1hWEUPk7oPwj0ExsJCAI9peB11GbWniOWg0O/Uf8vZbvK8bkPKPtaVDtZI0FWlwbg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBFen9SrJg3Y0SPeHtkSBfiObIoAFBmx1HuHwAFoyyirAiEAgJRy3Ac3EeoM1vZUWGJ3DG/gdSob2ESu4ZKhp31+vvw="}]},"maintainers":[{"name":"hypercubed","email":"hypercubed@gmail.com"}]}},"readme":"# mime-lookup\n\nComprehensive MIME type mapping API based on [broofa/node-mime](https://github.com/APIs-guru/mime) module.\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/Hypercubed/mime-lookup/blob/master/LICENSE)\n\n## Difference from node-mime\n\n1. This module does not include a mime type database.  Either supply your own, as described below, or include [mime-db](https://github.com/jshttp/mime-db).\n2. No command line tool.  Since no mime types are included this is not possible using this API only module.\n3. `Mime.prototype.load` has been removed to avoid dependency on Node File System.\n4. Added 'glob' function to expand mime patterns by [APIs-guru](https://github.com/APIs-guru/node-mime).\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm) (mime-db is optional):\n\n```bash\nnpm install mime-lookup mime-db\n```\n\n**mine-db is optional and only needed it you wish to use the mime-db mime-type database.**\n\n## Contributing / Testing\n\n```bash\nnpm test\n```\n\n## API\n\n### MimeLookup(db)\n\nThis module does not include the mime types database.  Either supply your own or include the [mime-db](https://github.com/jshttp/mime-db).  Construct a new mime type lookup service by supplying a mime type database.\n\n#### Using [mime-db](https://github.com/jshttp/mime-db)\n\n```js\nvar MimeLookup = require('mime-lookup');\nvar mime = new MimeLookup(require('mime-db'));\n```\n\n#### Using your own types\n```js\nvar MimeLookup = require('mime-lookup');\nvar mime = new MimeLookup(yourDb);\n```\n\nThe mime-type database can be formatted two ways:\n\n*Simple*\n```json\n{\n    \"text/x-some-format\": [\"x-sf\", \"x-sft\", \"x-sfml\"],\n    \"application/x-my-type\": [\"x-mt\", \"x-mtt\"]\n}\n```\n\n*Like mime-db*\n```json\n{\n  \"text/x-some-format\": {\n    \"source\": \"iana\",\n    \"extensions\": [\"x-sf\", \"x-sft\", \"x-sfml\"]\n  },\n  \"application/x-my-type\": {\n    \"source\": \"apache\",\n    \"extensions\": [\"x-mt\", \"x-mtt\"]\n  }\n}\n```\n\n**Note in this case only the \"extensions\" property is used**\n\n### mime.lookup(path)\n\nGet 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.\n\n```js\nmime.lookup('file.txt');                  // => 'text/plain'\nmime.lookup('.TXT');                      // => 'text/plain'\nmime.lookup('htm');                       // => 'text/html'\n```\n\n### mime.default_type\n\nSets the mime type returned when `mime.lookup` fails to find the extension searched for\n\n### mime.extension(type)\nGet the default extension for `type`\n\n```js\nmime.extension('text/html');                 // => 'html'\nmime.extension('application/octet-stream');  // => 'bin'\n```\n\n### mime.charsets.lookup()\n\nMap mime-type to charset\n\n```js\nmime.charsets.lookup('text/plain');        // => 'UTF-8'\n```\n\n### mime.define()\n\nAdd additional custom mime/extension mappings\n\n```js\nmime.define({\n    'text/x-some-format': ['x-sf', 'x-sft', 'x-sfml'],\n    'application/x-my-type': ['x-mt', 'x-mtt'],\n    // etc ...\n});\n\nmime.lookup('x-sft');                 // => 'text/x-some-format'\n```\n\nThe first entry in the extensions array is returned by `mime.extension()`. E.g.\n\n```js\nmime.extension('text/x-some-format'); // => 'x-sf'\n```\n\n## Acknowledgements\n\nThis code is based on [broofa/node-mime](https://github.com/APIs-guru/mime) with additions from  [APIs-guru](https://github.com/APIs-guru/node-mime).\n\n## License\n\nOriginal work Copyright (c) 2010 Benjamin Thomas, Robert Kieffer\nModified work Copyright 2015 Jayson Harshbarger\n\n[MIT License](https://github.com/Hypercubed/mime-lookup/blob/master/LICENSE)\n","maintainers":[{"name":"hypercubed","email":"hypercubed@gmail.com"}],"time":{"modified":"2022-06-19T19:54:41.283Z","created":"2015-09-07T09:51:06.383Z","0.0.1":"2015-09-07T09:51:06.383Z","0.0.2":"2015-10-05T02:38:12.096Z"},"homepage":"https://github.com/Hypercubed/mime-lookup#readme","keywords":["util","mime"],"repository":{"type":"git","url":"git+https://github.com/Hypercubed/mime-lookup.git"},"contributors":[{"name":"Benjamin Thomas","email":"benjamin@benjaminthomas.org","url":"http://github.com/bentomas"},{"name":"Robert Kieffer","email":"robert@broofa.com","url":"http://github.com/broofa"}],"author":{"name":"J. Harshbarger"},"bugs":{"url":"https://github.com/Hypercubed/mime-lookup/issues"},"license":"MIT","readmeFilename":"README.md","users":{"hypercubed":true}}