UNPKG

motion

Version:

motion - moving development forward

79 lines (78 loc) 4.17 kB
{ "_args": [ [ "mime@https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "mime@1.3.4", "_id": "mime@1.3.4", "_inCache": true, "_location": "/mime", "_phantomChildren": {}, "_requested": { "name": "mime", "raw": "mime@https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "rawSpec": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "scope": null, "spec": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "type": "remote" }, "_requiredBy": [ "/send", "/serve-static/send" ], "_resolved": "https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "_shasum": "115f9e3b6b3daf2959983cb38f149a2d40eb5d53", "_shrinkwrap": null, "_spec": "mime@https://registry.npmjs.org/mime/-/mime-1.3.4.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "email": "robert@broofa.com", "name": "Robert Kieffer", "url": "http://github.com/broofa" }, "bin": { "mime": "cli.js" }, "bugs": { "url": "https://github.com/broofa/node-mime/issues" }, "contributors": [ { "name": "Benjamin Thomas", "email": "benjamin@benjaminthomas.org", "url": "http://github.com/bentomas" } ], "dependencies": {}, "description": "A comprehensive library for mime-type mapping", "devDependencies": { "mime-db": "^1.2.0" }, "homepage": "https://github.com/broofa/node-mime#readme", "keywords": [ "mime", "util" ], "licenses": [ { "type": "MIT", "url": "https://raw.github.com/broofa/node-mime/master/LICENSE" } ], "main": "mime.js", "name": "mime", "optionalDependencies": {}, "readme": "# mime\n\nComprehensive MIME type mapping API based on mime-db module.\n\n## Install\n\nInstall with [npm](http://github.com/isaacs/npm):\n\n npm install mime\n\n## Contributing / Testing\n\n npm run test\n\n## Command Line\n\n mime [path_string]\n\nE.g.\n\n > mime scripts/jquery.js\n application/javascript\n\n## API - Queries\n\n### mime.lookup(path)\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\nvar mime = require('mime');\n\nmime.lookup('/path/to/file.txt'); // => 'text/plain'\nmime.lookup('file.txt'); // => 'text/plain'\nmime.lookup('.TXT'); // => 'text/plain'\nmime.lookup('htm'); // => 'text/html'\n```\n\n### mime.default_type\nSets the mime type returned when `mime.lookup` fails to find the extension searched for. (Default is `application/octet-stream`.)\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(The logic for charset lookups is pretty rudimentary. Feel free to suggest improvements.)\n\n## API - Defining Custom Types\n\nCustom type mappings can be added on a per-project basis via the following APIs.\n\n### mime.define()\n\nAdd 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### mime.load(filepath)\n\nLoad mappings from an Apache \".types\" format file\n\n```js\nmime.load('./my_project.types');\n```\nThe .types file format is simple - See the `types` dir for examples.\n", "readmeFilename": "README.md", "repository": { "type": "git", "url": "git+https://github.com/broofa/node-mime.git" }, "scripts": { "prepublish": "node build/build.js > types.json", "test": "node build/test.js" }, "version": "1.3.4" }