initial commit
This commit is contained in:
6
node_modules/is-resolvable/LICENSE
generated
vendored
Normal file
6
node_modules/is-resolvable/LICENSE
generated
vendored
Normal file
@@ -0,0 +1,6 @@
|
||||
ISC License (ISC)
|
||||
Copyright 2018 Shinnosuke Watanabe
|
||||
|
||||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
73
node_modules/is-resolvable/README.md
generated
vendored
Normal file
73
node_modules/is-resolvable/README.md
generated
vendored
Normal file
@@ -0,0 +1,73 @@
|
||||
# is-resolvable
|
||||
|
||||
[](https://www.npmjs.com/package/is-resolvable)
|
||||
[](https://travis-ci.org/shinnn/is-resolvable)
|
||||
[](https://ci.appveyor.com/project/ShinnosukeWatanabe/is-resolvable)
|
||||
[](https://coveralls.io/r/shinnn/is-resolvable)
|
||||
|
||||
A [Node.js](https://nodejs.org/) module to check if a given module ID is resolvable with [`require()`](https://nodejs.org/api/globals.html#globals_require)
|
||||
|
||||
```javascript
|
||||
const isResolvable = require('is-resolvable');
|
||||
|
||||
isResolvable('fs'); //=> true
|
||||
isResolvable('path'); //=> true
|
||||
|
||||
// When ./index.js exists
|
||||
isResolvable('./index.js') //=> true
|
||||
isResolvable('./index') //=> true
|
||||
isResolvable('.') //=> true
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
[Use](https://docs.npmjs.com/cli/install) [npm](https://docs.npmjs.com/getting-started/what-is-npm).
|
||||
|
||||
```
|
||||
npm install is-resolvable
|
||||
```
|
||||
|
||||
## API
|
||||
|
||||
```javascript
|
||||
const isResolvable = require('is-resolvable');
|
||||
```
|
||||
|
||||
### isResolvable(*moduleId* [, *options*])
|
||||
|
||||
*moduleId*: `string` (module ID)
|
||||
*options*: `Object` ([`require.resolve`](https://nodejs.org/api/modules.html#modules_require_resolve_request_options) options)
|
||||
Return: `boolean`
|
||||
|
||||
It returns `true` if `require()` can load a file form a given module ID, otherwise `false`.
|
||||
|
||||
```javascript
|
||||
const isResolvable = require('is-resolvable');
|
||||
|
||||
// When ./foo.json exists
|
||||
isResolvable('./foo.json'); //=> true
|
||||
isResolvable('./foo'); //=> true
|
||||
|
||||
isResolvable('./foo.js'); //=> false
|
||||
|
||||
// When `eslint` module is installed but `jshint` isn't
|
||||
isResolvable('eslint'); //=> true
|
||||
isResolvable('jshint'); //=> false
|
||||
|
||||
// When `lodash` module is installed
|
||||
isResolvable('lodash/isObject'); //=> true
|
||||
isResolvable('lodash/fp/reject.js'); //=> true
|
||||
```
|
||||
|
||||
The second argument accepts an options object for `require.resolve()`.
|
||||
|
||||
```javascript
|
||||
// When ./bar/baz.js exists
|
||||
|
||||
isResolvable('./baz.js'); //=> false
|
||||
isResolvable('./baz.js', {paths: ['bar']}); //=> true
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[ISC License](./LICENSE) © 2018 Shinnosuke Watanabe
|
||||
16
node_modules/is-resolvable/index.js
generated
vendored
Normal file
16
node_modules/is-resolvable/index.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
'use strict';
|
||||
|
||||
var inspect = require('util').inspect;
|
||||
|
||||
module.exports = function isResolvable(moduleId, options) {
|
||||
if (typeof moduleId !== 'string') {
|
||||
throw new TypeError(inspect(moduleId) + ' is not a string. Expected a valid Node.js module identifier (<string>), for example \'eslint\', \'./index.js\', \'./lib\'.');
|
||||
}
|
||||
|
||||
try {
|
||||
require.resolve(moduleId, options);
|
||||
return true;
|
||||
} catch (err) {
|
||||
return false;
|
||||
}
|
||||
};
|
||||
72
node_modules/is-resolvable/package.json
generated
vendored
Normal file
72
node_modules/is-resolvable/package.json
generated
vendored
Normal file
@@ -0,0 +1,72 @@
|
||||
{
|
||||
"_from": "is-resolvable@^1.0.0",
|
||||
"_id": "is-resolvable@1.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==",
|
||||
"_location": "/is-resolvable",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "is-resolvable@^1.0.0",
|
||||
"name": "is-resolvable",
|
||||
"escapedName": "is-resolvable",
|
||||
"rawSpec": "^1.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/cssnano"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz",
|
||||
"_shasum": "fb18f87ce1feb925169c9a407c19318a3206ed88",
|
||||
"_spec": "is-resolvable@^1.0.0",
|
||||
"_where": "D:\\Air66 Files\\dev_sites\\www.airurl.dev.cc\\user\\plugins\\air66Theme\\node_modules\\cssnano",
|
||||
"author": {
|
||||
"name": "Shinnosuke Watanabe",
|
||||
"url": "https://github.com/shinnn"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/shinnn/is-resolvable/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"deprecated": false,
|
||||
"description": "Check if a module ID is resolvable with require()",
|
||||
"devDependencies": {
|
||||
"@shinnn/eslint-config-node": "^5.0.0",
|
||||
"eslint": "^4.16.0",
|
||||
"istanbul": "^0.4.5",
|
||||
"tape": "^4.8.0"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": "@shinnn/node",
|
||||
"rules": {
|
||||
"no-var": "off",
|
||||
"prefer-template": "off"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"index.js"
|
||||
],
|
||||
"homepage": "https://github.com/shinnn/is-resolvable#readme",
|
||||
"keywords": [
|
||||
"file",
|
||||
"path",
|
||||
"resolve",
|
||||
"resolvable",
|
||||
"check",
|
||||
"module"
|
||||
],
|
||||
"license": "ISC",
|
||||
"name": "is-resolvable",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/shinnn/is-resolvable.git"
|
||||
},
|
||||
"scripts": {
|
||||
"coverage": "istanbul cover --print=both test.js",
|
||||
"pretest": "eslint --fix --format=codeframe index.js test.js",
|
||||
"test": "node --throw-deprecation --track-heap-objects test.js"
|
||||
},
|
||||
"version": "1.1.0"
|
||||
}
|
||||
Reference in New Issue
Block a user