fdsfd
This commit is contained in:
parent
628618df89
commit
e031240dff
3749 changed files with 1120848 additions and 1 deletions
51
node_modules/import-cwd/index.d.ts
generated
vendored
Normal file
51
node_modules/import-cwd/index.d.ts
generated
vendored
Normal file
|
@ -0,0 +1,51 @@
|
|||
declare const importCwd: {
|
||||
/**
|
||||
Import a module like with [`require()`](https://nodejs.org/api/globals.html#globals_require) but from the current working directory.
|
||||
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@throws Like `require()`, throws when the module can't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
import importCwd = require('import-cwd');
|
||||
|
||||
// Target module is at '/Users/sindresorhus/unicorn/foo.js'
|
||||
|
||||
console.log(__dirname);
|
||||
//=> '/Users/sindresorhus/rainbow'
|
||||
|
||||
console.log(process.cwd());
|
||||
//=> '/Users/sindresorhus/unicorn'
|
||||
|
||||
const foo = importCwd('./foo');
|
||||
```
|
||||
*/
|
||||
(moduleId: string): unknown;
|
||||
|
||||
|
||||
/**
|
||||
Import a module like with [`require()`](https://nodejs.org/api/globals.html#globals_require) but from the current working directory.
|
||||
|
||||
@param moduleId - What you would use in `require()`.
|
||||
@returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
@example
|
||||
```
|
||||
import importCwd = require('import-cwd');
|
||||
|
||||
// '/Users/sindresorhus/empty/' is empty
|
||||
|
||||
console.log(__dirname);
|
||||
//=> '/Users/sindresorhus/rainbow'
|
||||
|
||||
console.log(process.cwd());
|
||||
//=> '/Users/sindresorhus/empty'
|
||||
|
||||
const foo = importCwd.silent('./nonexistent');
|
||||
//=> undefined
|
||||
```
|
||||
*/
|
||||
silent(moduleId: string): unknown;
|
||||
};
|
||||
|
||||
export = importCwd;
|
5
node_modules/import-cwd/index.js
generated
vendored
Normal file
5
node_modules/import-cwd/index.js
generated
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
'use strict';
|
||||
const importFrom = require('import-from');
|
||||
|
||||
module.exports = moduleId => importFrom(process.cwd(), moduleId);
|
||||
module.exports.silent = moduleId => importFrom.silent(process.cwd(), moduleId);
|
9
node_modules/import-cwd/license
generated
vendored
Normal file
9
node_modules/import-cwd/license
generated
vendored
Normal file
|
@ -0,0 +1,9 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
||||
|
||||
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.
|
78
node_modules/import-cwd/package.json
generated
vendored
Normal file
78
node_modules/import-cwd/package.json
generated
vendored
Normal file
|
@ -0,0 +1,78 @@
|
|||
{
|
||||
"_args": [
|
||||
[
|
||||
"import-cwd@3.0.0",
|
||||
"/d"
|
||||
]
|
||||
],
|
||||
"_from": "import-cwd@3.0.0",
|
||||
"_id": "import-cwd@3.0.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-4pnzH16plW+hgvRECbDWpQl3cqtvSofHWh44met7ESfZ8UZOWWddm8hEyDTqREJ9RbYHY8gi8DqmaelApoOGMg==",
|
||||
"_location": "/import-cwd",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "import-cwd@3.0.0",
|
||||
"name": "import-cwd",
|
||||
"escapedName": "import-cwd",
|
||||
"rawSpec": "3.0.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "3.0.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-load-config"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/import-cwd/-/import-cwd-3.0.0.tgz",
|
||||
"_spec": "3.0.0",
|
||||
"_where": "/d",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
"url": "sindresorhus.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/sindresorhus/import-cwd/issues"
|
||||
},
|
||||
"dependencies": {
|
||||
"import-from": "^3.0.0"
|
||||
},
|
||||
"description": "Import a module like with `require()` but from the current working directory",
|
||||
"devDependencies": {
|
||||
"ava": "^1.4.1",
|
||||
"tsd": "^0.7.2",
|
||||
"xo": "^0.24.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
"index.d.ts"
|
||||
],
|
||||
"homepage": "https://github.com/sindresorhus/import-cwd#readme",
|
||||
"keywords": [
|
||||
"require",
|
||||
"resolve",
|
||||
"path",
|
||||
"module",
|
||||
"from",
|
||||
"like",
|
||||
"cwd",
|
||||
"current",
|
||||
"working",
|
||||
"directory",
|
||||
"import"
|
||||
],
|
||||
"license": "MIT",
|
||||
"name": "import-cwd",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/sindresorhus/import-cwd.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "3.0.0"
|
||||
}
|
59
node_modules/import-cwd/readme.md
generated
vendored
Normal file
59
node_modules/import-cwd/readme.md
generated
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
# import-cwd [](https://travis-ci.org/sindresorhus/import-cwd)
|
||||
|
||||
> Import a module like with [`require()`](https://nodejs.org/api/globals.html#globals_require) but from the current working directory
|
||||
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install import-cwd
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
const importCwd = require('import-cwd');
|
||||
|
||||
// Target module is at '/Users/sindresorhus/unicorn/foo.js'
|
||||
|
||||
console.log(__dirname);
|
||||
//=> '/Users/sindresorhus/rainbow'
|
||||
|
||||
console.log(process.cwd());
|
||||
//=> '/Users/sindresorhus/unicorn'
|
||||
|
||||
const foo = importCwd('./foo');
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### importCwd(moduleId)
|
||||
|
||||
Like `require()`, throws when the module can't be found.
|
||||
|
||||
### importCwd.silent(moduleId)
|
||||
|
||||
Returns `undefined` instead of throwing when the module can't be found.
|
||||
|
||||
#### moduleId
|
||||
|
||||
Type: `string`
|
||||
|
||||
What you would use in `require()`.
|
||||
|
||||
|
||||
## Related
|
||||
|
||||
- [import-from](https://github.com/sindresorhus/import-from) - Import a module from a given path
|
||||
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path
|
||||
- [resolve-cwd](https://github.com/sindresorhus/resolve-cwd) - Resolve the path of a module from the current working directory
|
||||
- [resolve-pkg](https://github.com/sindresorhus/resolve-pkg) - Resolve the path of a package regardless of it having an entry point
|
||||
- [import-lazy](https://github.com/sindresorhus/import-lazy) - Import modules lazily
|
||||
- [import-global](https://github.com/sindresorhus/import-global) - Import a globally installed module
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [Sindre Sorhus](https://sindresorhus.com)
|
Loading…
Add table
Add a link
Reference in a new issue