aboutsummaryrefslogtreecommitdiff
path: root/node_modules/resolve-from/readme.md
diff options
context:
space:
mode:
authorWaref Haque <warefhaque@Warefs-MacBook-Pro.local>2016-07-17 20:24:49 +0000
committerWaref Haque <warefhaque@Warefs-MacBook-Pro.local>2016-07-17 20:24:49 +0000
commite58943c3e620f05937656fdde032254ae3373f36 (patch)
tree77072aa55efa1753c8c8ae584669cf3589551268 /node_modules/resolve-from/readme.md
parent55098c767afb0b119aaeda330eaedba5c1a87dc3 (diff)
redirect commit
Diffstat (limited to 'node_modules/resolve-from/readme.md')
-rw-r--r--node_modules/resolve-from/readme.md58
1 files changed, 58 insertions, 0 deletions
diff --git a/node_modules/resolve-from/readme.md b/node_modules/resolve-from/readme.md
new file mode 100644
index 0000000..bb4ca91
--- /dev/null
+++ b/node_modules/resolve-from/readme.md
@@ -0,0 +1,58 @@
+# resolve-from [![Build Status](https://travis-ci.org/sindresorhus/resolve-from.svg?branch=master)](https://travis-ci.org/sindresorhus/resolve-from)
+
+> Resolve the path of a module like [`require.resolve()`](http://nodejs.org/api/globals.html#globals_require_resolve) but from a given path
+
+Unlike `require.resolve()` it returns `null` instead of throwing when the module can't be found.
+
+
+## Install
+
+```
+$ npm install --save resolve-from
+```
+
+
+## Usage
+
+```js
+const resolveFrom = require('resolve-from');
+
+// there's a file at `./foo/bar.js`
+
+resolveFrom('foo', './bar');
+//=> '/Users/sindresorhus/dev/test/foo/bar.js'
+```
+
+
+## API
+
+### resolveFrom(fromDir, moduleId)
+
+#### fromDir
+
+Type: `string`
+
+Directory to resolve from.
+
+#### moduleId
+
+Type: `string`
+
+What you would use in `require()`.
+
+
+## Tip
+
+Create a partial using a bound function if you want to require from the same `fromDir` multiple times:
+
+```js
+const resolveFromFoo = resolveFrom.bind(null, 'foo');
+
+resolveFromFoo('./bar');
+resolveFromFoo('./baz');
+```
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)