Files
zoff/server/node_modules/gulp/node_modules/interpret/package.json

61 lines
4.0 KiB
JSON

{
"name": "interpret",
"description": "A dictionary of file extensions and associated module loaders.",
"version": "0.6.2",
"homepage": "https://github.com/tkellen/node-interpret",
"author": {
"name": "Tyler Kellen",
"url": "http://goingslowly.com/"
},
"repository": {
"type": "git",
"url": "git://github.com/tkellen/node-interpret.git"
},
"bugs": {
"url": "https://github.com/tkellen/node-interpret/issues"
},
"licenses": [
{
"type": "MIT",
"url": "https://github.com/tkellen/node-interpret/blob/master/LICENSE"
}
],
"main": "index.js",
"keywords": [
"cirru-script",
"cjsx",
"co",
"coco",
"coffee-script",
"coffee",
"coffee.md",
"csv",
"es",
"es6",
"iced",
"iced.md",
"iced-coffee-script",
"ini",
"js",
"json",
"json5",
"jsx",
"react",
"litcoffee",
"liticed",
"ls",
"livescript",
"toml",
"ts",
"typescript",
"wisp",
"xml",
"yaml",
"yml"
],
"readme": "# interpret\n> A dictionary of file extensions and associated module loaders.\n\n[![NPM](https://nodei.co/npm/interpret.png)](https://nodei.co/npm/interpret/)\n\n## What is it\nThis is used by [Liftoff](http://github.com/tkellen/node-liftoff) to automatically require dependencies for configuration files, and by [rechoir](http://github.com/tkellen/node-rechoir) for registering module loaders.\n\n## API\n\n### extensions\nMap file types to modules which provide a [require.extensions] loader.\n\n```js\n{\n '.babel.js': {\n module: 'babel/register',\n register: function (module) {\n module({\n // register on .js extension due to https://github.com/joyent/node/blob/v0.12.0/lib/module.js#L353\n // which only captures the final extension (.babel.js -> .js)\n extensions: '.js'\n })\n }\n },\n '.cirru': 'cirru-script/lib/register',\n '.cjsx': 'node-cjsx/register',\n '.co': 'coco',\n '.coffee': ['coffee-script/register', 'coffee-script'],\n '.coffee.md': ['coffee-script/register', 'coffee-script'],\n '.csv': 'require-csv',\n '.iced': ['iced-coffee-script/register', 'iced-coffee-script'],\n '.iced.md': 'iced-coffee-script/register',\n '.ini': 'require-ini',\n '.js': null,\n '.json': null,\n '.json5': 'json5/lib/require',\n '.jsx': [\n {\n module: 'babel/register',\n register: function (module) {\n module({\n extensions: '.jsx'\n });\n },\n },\n {\n module: 'node-jsx',\n register: function (module) {\n module.install({\n extension: '.jsx',\n harmony: true\n });\n }\n }\n ],\n '.litcoffee': ['coffee-script/register', 'coffee-script'],\n '.liticed': 'iced-coffee-script/register',\n '.ls': ['livescript', 'LiveScript'],\n '.node': null,\n '.toml': {\n module: 'toml-require',\n register: function (module) {\n module.install();\n }\n },\n '.ts': ['typescript-register', 'typescript-require'],\n '.wisp': 'wisp/engine/node',\n '.xml': 'require-xml',\n '.yaml': 'require-yaml',\n '.yml': 'require-yaml'\n};\n```\n\n### jsVariants\nSame as above, but only include the extensions which are javascript variants.\n\n## How to use it\n\nConsumers should use the exported `extensions` or `jsVariants` object to determine which module should be loaded for a given extension. If a matching extension is found, consumers should do the following:\n\n1. If the value is null, do nothing.\n\n2. If the value is a string, try to require it.\n\n3. If the value is an object, try to require the `module` property. If successful, the `register` property (a function) should be called with the module passed as the first argument.\n\n4. If the value is an array, iterate over it, attempting step #2 or #3 until one of the attempts does not throw.\n\n[require.extensions]: http://nodejs.org/api/globals.html#globals_require_extensions\n",
"readmeFilename": "README.md",
"_id": "interpret@0.6.2",
"_from": "interpret@^0.6.2"
}