UNPKG

motion

Version:

motion - moving development forward

86 lines (85 loc) 5.02 kB
{ "_args": [ [ "interpret@https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", "/Users/nw/flint/packages/flint" ] ], "_from": "interpret@>=0.6.2 <0.7.0", "_id": "interpret@0.6.6", "_inCache": true, "_location": "/interpret", "_phantomChildren": {}, "_requested": { "name": "interpret", "raw": "interpret@https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", "rawSpec": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", "scope": null, "spec": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", "type": "remote" }, "_requiredBy": [ "/gulp", "/webpack" ], "_resolved": "https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", "_shasum": "fecd7a18e7ce5ca6abfb953e1f86213a49f1625b", "_shrinkwrap": null, "_spec": "interpret@https://registry.npmjs.org/interpret/-/interpret-0.6.6.tgz", "_where": "/Users/nw/flint/packages/flint", "author": { "name": "Tyler Kellen", "url": "http://goingslowly.com/" }, "bugs": { "url": "https://github.com/tkellen/node-interpret/issues" }, "dependencies": {}, "description": "A dictionary of file extensions and associated module loaders.", "devDependencies": {}, "homepage": "https://github.com/tkellen/node-interpret", "keywords": [ "cirru-script", "cjsx", "co", "coco", "coffee", "coffee-script", "coffee.md", "csv", "earlgrey", "es", "es6", "iced", "iced-coffee-script", "iced.md", "ini", "js", "json", "json5", "jsx", "litcoffee", "liticed", "livescript", "ls", "react", "toml", "ts", "typescript", "wisp", "xml", "yaml", "yml" ], "license": "MIT", "main": "index.js", "name": "interpret", "optionalDependencies": {}, "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 '.eg': 'earlgrey/register',\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-node/register', 'typescript-register', 'typescript-require'],\n '.tsx': ['typescript-node/register'],\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", "repository": { "type": "git", "url": "git://github.com/tkellen/node-interpret.git" }, "version": "0.6.6" }