initial
This commit is contained in:
1
node_modules/rechoir/.npmignore
generated
vendored
Normal file
1
node_modules/rechoir/.npmignore
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
test
|
24
node_modules/rechoir/.travis.yml
generated
vendored
Normal file
24
node_modules/rechoir/.travis.yml
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- "0.12"
|
||||
env:
|
||||
global:
|
||||
- REMOVE_DEPS=""
|
||||
matrix:
|
||||
- "CUSTOM_DEPS=coffee-script@~1.3"
|
||||
- "CUSTOM_DEPS=coffee-script@~1.5"
|
||||
- "CUSTOM_DEPS=coffee-script@~1.7"
|
||||
- "CUSTOM_DEPS=coffee-script@latest"
|
||||
- "CUSTOM_DEPS=iced-coffee-script@1.6.3-j"
|
||||
- "CUSTOM_DEPS=iced-coffee-script@latest"
|
||||
- "CUSTOM_DEPS=LiveScript@1.3.1 REMOVE_DEPS=livescript"
|
||||
- "CUSTOM_DEPS=typescript-require REMOVE_DEPS=typescript-register"
|
||||
matrix:
|
||||
fast_finish: true
|
||||
before_install:
|
||||
- "npm install -g npm" # needs the newest version of npm
|
||||
before_script:
|
||||
- "[ \"${REMOVE_DEPS}\" == \"\" ] || npm rm $REMOVE_DEPS"
|
||||
- "npm install $CUSTOM_DEPS" # install a specific version of dependencies
|
38
node_modules/rechoir/CHANGELOG
generated
vendored
Normal file
38
node_modules/rechoir/CHANGELOG
generated
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
v0.6.2:
|
||||
date: 2015-07-22
|
||||
changes:
|
||||
- Return `undefined` when an unknown extension is provided to prepare and
|
||||
the `nothrow` option is specified.
|
||||
v0.6.1:
|
||||
date: 2015-05-22
|
||||
changes:
|
||||
- Add option for not throwing.
|
||||
v0.6.0:
|
||||
date: 2015-05-20
|
||||
changes:
|
||||
- Include module name when prepare is successful.
|
||||
v0.5.0:
|
||||
date: 2015-05-20
|
||||
changes:
|
||||
- Overhaul to support interpret 0.6.0.
|
||||
v0.3.0:
|
||||
date: 2015-01-10
|
||||
changes:
|
||||
- Breaking: `load` method removed.
|
||||
- Improved extension recognition.
|
||||
- No longer fails upon dots in filenames.
|
||||
- Support confuration objects.
|
||||
- Support and test ES6.
|
||||
- Support legacy module loading.
|
||||
v0.2.2:
|
||||
date: 2014-12-17
|
||||
changes:
|
||||
- Expose interpret.
|
||||
v0.2.0:
|
||||
date: 2014-04-20
|
||||
changes:
|
||||
- Simplify loading of coffee-script and iced-coffee-script.
|
||||
v0.1.0:
|
||||
date: 2014-04-20
|
||||
changes:
|
||||
- Initial public release.
|
22
node_modules/rechoir/LICENSE
generated
vendored
Normal file
22
node_modules/rechoir/LICENSE
generated
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
Copyright (c) 2015 Tyler Kellen
|
||||
|
||||
Permission is hereby granted, free of charge, to any person
|
||||
obtaining a copy of this software and associated documentation
|
||||
files (the "Software"), to deal in the Software without
|
||||
restriction, including without limitation the rights to use,
|
||||
copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following
|
||||
conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
42
node_modules/rechoir/README.md
generated
vendored
Normal file
42
node_modules/rechoir/README.md
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
# rechoir [](http://travis-ci.org/tkellen/js-rechoir)
|
||||
> Require any supported file as a node module.
|
||||
|
||||
[](https://nodei.co/npm/rechoir/)
|
||||
|
||||
## What is it?
|
||||
This module, in conjunction with [interpret]-like objects can register any file type the npm ecosystem has a module loader for. This library is a dependency of [Liftoff].
|
||||
|
||||
## API
|
||||
|
||||
### prepare(config, filepath, requireFrom)
|
||||
Look for a module loader associated with the provided file and attempt require it. If necessary, run any setup required to inject it into [require.extensions](http://nodejs.org/api/globals.html#globals_require_extensions).
|
||||
|
||||
`config` An [interpret]-like configuration object.
|
||||
|
||||
`filepath` A file whose type you'd like to register a module loader for.
|
||||
|
||||
`requireFrom` An optional path to start searching for the module required to load the requested file. Defaults to the directory of `filepath`.
|
||||
|
||||
If calling this method is successful (aka: it doesn't throw), you can now require files of the type you requested natively.
|
||||
|
||||
An error with a `failures` property will be thrown if the module loader(s) configured for a given extension cannot be registered.
|
||||
|
||||
If a loader is already registered, this will simply return `true`.
|
||||
|
||||
**Note:** While rechoir will automatically load and register transpilers like `coffee-script`, you must provide a local installation. The transpilers are **not** bundled with this module.
|
||||
|
||||
#### Usage
|
||||
```js
|
||||
const config = require('interpret').extensions;
|
||||
const rechoir = require('rechoir');
|
||||
rechoir.prepare(config, './test/fixtures/test.coffee');
|
||||
rechoir.prepare(config, './test/fixtures/test.csv');
|
||||
rechoir.prepare(config, './test/fixtures/test.toml');
|
||||
|
||||
console.log(require('./test/fixtures/test.coffee'));
|
||||
console.log(require('./test/fixtures/test.csv'));
|
||||
console.log(require('./test/fixtures/test.toml'));
|
||||
```
|
||||
|
||||
[interpret]: http://github.com/tkellen/js-interpret
|
||||
[Liftoff]: http://github.com/tkellen/js-liftoff
|
59
node_modules/rechoir/index.js
generated
vendored
Normal file
59
node_modules/rechoir/index.js
generated
vendored
Normal file
@ -0,0 +1,59 @@
|
||||
const path = require('path');
|
||||
|
||||
const extension = require('./lib/extension');
|
||||
const normalize = require('./lib/normalize');
|
||||
const register = require('./lib/register');
|
||||
|
||||
exports.prepare = function (extensions, filepath, cwd, nothrow) {
|
||||
var option, attempt;
|
||||
var attempts = [];
|
||||
var err;
|
||||
var onlyErrors = false;
|
||||
var ext = extension(filepath);
|
||||
if (Object.keys(require.extensions).indexOf(ext) !== -1) {
|
||||
return true;
|
||||
}
|
||||
var config = normalize(extensions[ext]);
|
||||
if (!config) {
|
||||
if (nothrow) {
|
||||
return;
|
||||
} else {
|
||||
throw new Error('No module loader found for "'+ext+'".');
|
||||
}
|
||||
}
|
||||
if (!cwd) {
|
||||
cwd = path.dirname(path.resolve(filepath));
|
||||
}
|
||||
if (!Array.isArray(config)) {
|
||||
config = [config];
|
||||
}
|
||||
for (var i in config) {
|
||||
option = config[i];
|
||||
attempt = register(cwd, option.module, option.register);
|
||||
error = (attempt instanceof Error) ? attempt : null;
|
||||
if (error) {
|
||||
attempt = null;
|
||||
}
|
||||
attempts.push({
|
||||
moduleName: option.module,
|
||||
module: attempt,
|
||||
error: error
|
||||
});
|
||||
if (!error) {
|
||||
onlyErrors = false;
|
||||
break;
|
||||
} else {
|
||||
onlyErrors = true;
|
||||
}
|
||||
}
|
||||
if (onlyErrors) {
|
||||
err = new Error('Unable to use specified module loaders for "'+ext+'".');
|
||||
err.failures = attempts;
|
||||
if (nothrow) {
|
||||
return err;
|
||||
} else {
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
return attempts;
|
||||
};
|
11
node_modules/rechoir/lib/extension.js
generated
vendored
Normal file
11
node_modules/rechoir/lib/extension.js
generated
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
const path = require('path');
|
||||
|
||||
const EXTRE = /^[.]?[^.]+([.].*)$/;
|
||||
|
||||
module.exports = function (input) {
|
||||
var extension = EXTRE.exec(path.basename(input));
|
||||
if (!extension) {
|
||||
return;
|
||||
}
|
||||
return extension[1];
|
||||
};
|
15
node_modules/rechoir/lib/normalize.js
generated
vendored
Normal file
15
node_modules/rechoir/lib/normalize.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
function normalizer (config) {
|
||||
if (typeof config === 'string') {
|
||||
return {
|
||||
module: config
|
||||
}
|
||||
}
|
||||
return config;
|
||||
};
|
||||
|
||||
module.exports = function (config) {
|
||||
if (Array.isArray(config)) {
|
||||
return config.map(normalizer);
|
||||
}
|
||||
return normalizer(config);
|
||||
};
|
15
node_modules/rechoir/lib/register.js
generated
vendored
Normal file
15
node_modules/rechoir/lib/register.js
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
const path = require('path');
|
||||
const resolve = require('resolve');
|
||||
|
||||
module.exports = function (cwd, moduleName, register) {
|
||||
try {
|
||||
var modulePath = resolve.sync(moduleName, {basedir: cwd});
|
||||
var result = require(modulePath);
|
||||
if (typeof register === 'function') {
|
||||
register(result);
|
||||
}
|
||||
} catch (e) {
|
||||
result = e;
|
||||
}
|
||||
return result;
|
||||
};
|
147
node_modules/rechoir/package.json
generated
vendored
Normal file
147
node_modules/rechoir/package.json
generated
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
{
|
||||
"name": "rechoir",
|
||||
"raw": "rechoir@^0.6.2",
|
||||
"rawSpec": "^0.6.2",
|
||||
"scope": null,
|
||||
"spec": ">=0.6.2 <0.7.0",
|
||||
"type": "range"
|
||||
},
|
||||
"/home/philkunz/gitlab/pushrocks/smartdrive/node_modules/shelljs"
|
||||
]
|
||||
],
|
||||
"_from": "rechoir@>=0.6.2 <0.7.0",
|
||||
"_id": "rechoir@0.6.2",
|
||||
"_inCache": true,
|
||||
"_installable": true,
|
||||
"_location": "/rechoir",
|
||||
"_nodeVersion": "0.12.4",
|
||||
"_npmUser": {
|
||||
"email": "tyler@sleekcode.net",
|
||||
"name": "tkellen"
|
||||
},
|
||||
"_npmVersion": "2.7.4",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"name": "rechoir",
|
||||
"raw": "rechoir@^0.6.2",
|
||||
"rawSpec": "^0.6.2",
|
||||
"scope": null,
|
||||
"spec": ">=0.6.2 <0.7.0",
|
||||
"type": "range"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/shelljs"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz",
|
||||
"_shasum": "85204b54dba82d5742e28c96756ef43af50e3384",
|
||||
"_shrinkwrap": null,
|
||||
"_spec": "rechoir@^0.6.2",
|
||||
"_where": "/home/philkunz/gitlab/pushrocks/smartdrive/node_modules/shelljs",
|
||||
"author": {
|
||||
"name": "Tyler Kellen",
|
||||
"url": "http://goingslowly.com/"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/tkellen/node-rechoir/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"resolve": "^1.1.6"
|
||||
},
|
||||
"description": "Require any supported file as a node module.",
|
||||
"devDependencies": {
|
||||
"babel": "^5.4.3",
|
||||
"chai": "^2.3.0",
|
||||
"coco": "^0.9.1",
|
||||
"coffee-script": "^1.9.2",
|
||||
"earlgrey": "0.0.9",
|
||||
"iced-coffee-script": "^1.8.0-d",
|
||||
"interpret": "^0.6.1",
|
||||
"json5": "^0.4.0",
|
||||
"livescript": "^1.4.0",
|
||||
"mocha": "^2.2.5",
|
||||
"node-jsx": "^0.13.3",
|
||||
"require-csv": "0.0.1",
|
||||
"require-ini": "0.0.1",
|
||||
"require-uncached": "^1.0.2",
|
||||
"require-xml": "0.0.1",
|
||||
"require-yaml": "0.0.1",
|
||||
"rimraf": "^2.3.4",
|
||||
"semver": "^4.3.4",
|
||||
"sinon": "^1.14.1",
|
||||
"toml-require": "^1.0.1",
|
||||
"typescript-register": "^1.1.0"
|
||||
},
|
||||
"directories": {},
|
||||
"dist": {
|
||||
"shasum": "85204b54dba82d5742e28c96756ef43af50e3384",
|
||||
"tarball": "https://registry.npmjs.org/rechoir/-/rechoir-0.6.2.tgz"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.10"
|
||||
},
|
||||
"gitHead": "1aafd85aac487171be71891b916c9136c620ac0e",
|
||||
"homepage": "https://github.com/tkellen/node-rechoir",
|
||||
"keywords": [
|
||||
"require",
|
||||
"cjsx",
|
||||
"co",
|
||||
"coco",
|
||||
"coffee-script",
|
||||
"coffee",
|
||||
"coffee.md",
|
||||
"csv",
|
||||
"earlgrey",
|
||||
"es",
|
||||
"es6",
|
||||
"iced",
|
||||
"iced.md",
|
||||
"iced-coffee-script",
|
||||
"ini",
|
||||
"js",
|
||||
"json",
|
||||
"json5",
|
||||
"jsx",
|
||||
"react",
|
||||
"litcoffee",
|
||||
"liticed",
|
||||
"ls",
|
||||
"livescript",
|
||||
"toml",
|
||||
"ts",
|
||||
"typescript",
|
||||
"xml",
|
||||
"yaml",
|
||||
"yml"
|
||||
],
|
||||
"licenses": [
|
||||
{
|
||||
"type": "MIT",
|
||||
"url": "https://github.com/tkellen/node-rechoir/blob/master/LICENSE"
|
||||
}
|
||||
],
|
||||
"main": "index.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"email": "tyler@sleekcode.net",
|
||||
"name": "tkellen"
|
||||
},
|
||||
{
|
||||
"email": "blaine@iceddev.com",
|
||||
"name": "phated"
|
||||
}
|
||||
],
|
||||
"name": "rechoir",
|
||||
"optionalDependencies": {},
|
||||
"readme": "ERROR: No README data found!",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/tkellen/node-rechoir.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "mocha -R spec test/index.js"
|
||||
},
|
||||
"version": "0.6.2"
|
||||
}
|
Reference in New Issue
Block a user