diff options
Diffstat (limited to 'node_modules/resolve-cwd')
-rw-r--r-- | node_modules/resolve-cwd/index.js | 7 | ||||
-rw-r--r-- | node_modules/resolve-cwd/package.json | 10 | ||||
-rw-r--r-- | node_modules/resolve-cwd/readme.md | 13 |
3 files changed, 17 insertions, 13 deletions
diff --git a/node_modules/resolve-cwd/index.js b/node_modules/resolve-cwd/index.js index c42468cc9..82dd33c90 100644 --- a/node_modules/resolve-cwd/index.js +++ b/node_modules/resolve-cwd/index.js @@ -1,6 +1,5 @@ 'use strict'; -var resolveFrom = require('resolve-from'); +const resolveFrom = require('resolve-from'); -module.exports = function (moduleId) { - return resolveFrom('.', moduleId); -}; +module.exports = moduleId => resolveFrom(process.cwd(), moduleId); +module.exports.silent = moduleId => resolveFrom.silent(process.cwd(), moduleId); diff --git a/node_modules/resolve-cwd/package.json b/node_modules/resolve-cwd/package.json index 5d410cbc0..15dd87fc0 100644 --- a/node_modules/resolve-cwd/package.json +++ b/node_modules/resolve-cwd/package.json @@ -1,6 +1,6 @@ { "name": "resolve-cwd", - "version": "1.0.0", + "version": "2.0.0", "description": "Resolve the path of a module like `require.resolve()` but from the current working directory", "license": "MIT", "repository": "sindresorhus/resolve-cwd", @@ -10,7 +10,7 @@ "url": "sindresorhus.com" }, "engines": { - "node": ">=0.10.0" + "node": ">=4" }, "scripts": { "test": "xo && ava" @@ -25,14 +25,14 @@ "module", "from", "like", - "path", "cwd", "current", "working", - "directory" + "directory", + "import" ], "dependencies": { - "resolve-from": "^2.0.0" + "resolve-from": "^3.0.0" }, "devDependencies": { "ava": "*", diff --git a/node_modules/resolve-cwd/readme.md b/node_modules/resolve-cwd/readme.md index 7f36e0296..46cdc36aa 100644 --- a/node_modules/resolve-cwd/readme.md +++ b/node_modules/resolve-cwd/readme.md @@ -1,8 +1,6 @@ # resolve-cwd [](https://travis-ci.org/sindresorhus/resolve-cwd) -> Resolve the path of a module like [`require.resolve()`](http://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory - -Unlike `require.resolve()` it returns `null` instead of throwing when the module can't be found. +> Resolve the path of a module like [`require.resolve()`](https://nodejs.org/api/globals.html#globals_require_resolve) but from the current working directory ## Install @@ -32,6 +30,12 @@ resolveCwd('./foo'); ### resolveCwd(moduleId) +Like `require()`, throws when the module can't be found. + +### resolveCwd.silent(moduleId) + +Returns `null` instead of throwing when the module can't be found. + #### moduleId Type: `string` @@ -44,9 +48,10 @@ What you would use in `require()`. - [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module from a given path - [req-from](https://github.com/sindresorhus/req-from) - Require a module from a given path - [req-cwd](https://github.com/sindresorhus/req-cwd) - Require 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 - [lazy-req](https://github.com/sindresorhus/lazy-req) - Require modules lazily ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) |