Resolve an absolute file path from local directories, local node_modules or global node_modules.
npm install resolve-file> Resolve an absolute file path from local directories, local node_modules or global node_modules.
Install with npm:
``sh`
$ npm install --save resolve-file
`js`
var resolveFile = require('resolve-file');
Resolve the path to a file located in one of the following places:
* local to the current project ('./index.js')'/usr/something.rc'
* absolute ()'cwd'
* node module "main" file ()'cwd/LICENSE'
* specific file inside a node module ()'~/.npmrc'
* file located in user's home directory ()
Example
`js`
var fp = resolve('./index.js')
//=> /path/to/resolve-file/index.js
Params
* name {String}: Filename to resolveoptions
* {Object}: Additional options to specify cwdreturns
* {String}: Resolved filepath if found
Resolve the path to a file located in one of the following places:
* local to the current project ('./index.js')'/usr/something.rc'
* absolute ()'cwd'
* node module "main" file ()'cwd/LICENSE'
* specific file inside a node module ()'~/.npmrc'
* file located in user's home directory ()
Example
`js`
var file = resolve.file('./index.js')
//=> {
//=> cwd: '/path/to/resolve-file',
//=> path: '/path/to/resolve-file/index.js'
//=> }
Params
* name {String}: Filename to resolveoptions
* {Object}: Additional options to specify cwdreturns
* {Object}: File object with resolved path if found.
* cwd: Easily get the CWD (current working directory) of a project based on package.json, optionally starting… more | homepage of a project based on package.json, optionally starting from a given path. (node.js/javascript util)")
* expand-tilde: Bash-like tilde expansion for node.js. Expands a leading tilde in a file path to the… more | ~+ to the cwd."" class="text-primary hover:underline" target="_blank" rel="noopener noreferrer">homepage
* look-up: Faster drop-in replacement for find-up and findup-sync. | homepage
* resolve: resolve like require.resolve() on behalf of files asynchronously and synchronously | homepage on behalf of files asynchronously and synchronously")
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
| Commits | Contributor
|
| --- | --- |
| 13 | doowb |
| 7 | jonschlinkert |
_(This document was generated by verb-generate-readme (a verb generator), please don't edit the readme directly. Any changes to the readme must be made in .verb.md.)_
To generate the readme and API documentation with verb:
`sh`
$ npm install -g verb verb-generate-readme && verb
Install dev dependencies:
`sh``
$ npm install -d && npm test
Brian Woodward
Copyright © 2016, Brian Woodward.
Released under the MIT license.
*
_This file was generated by verb-generate-readme, v0.2.0, on October 19, 2016._