Sha256: 1b1f842a019b253b9fb18429b513398d97c1b7af8866e1389b59285deed95b98

Contents?: true

Size: 1.23 KB

Versions: 3

Compression:

Stored size: 1.23 KB

Contents

resolve
=======

Implements the [node `require.resolve()`
algorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...)
except you can pass in the file to compute paths relatively to along with your
own `require.paths` without updating the global copy (which doesn't even work in
node `>=0.5`).

[![build status](https://secure.travis-ci.org/substack/node-resolve.png)](http://travis-ci.org/substack/node-resolve)

methods
=======

var resolve = require('resolve');

resolve.sync(pkg, opts)
-----------------------

Synchronously search for the package/filename string `pkg`
according to the [`require.resolve()`
algorithm](http://nodejs.org/docs/v0.4.8/api/all.html#all_Together...)
for `X=pkg` and `Y=opts.basedir`.

Default values for `opts`:

````javascript
{
    paths : [],
    basedir : __dirname,
    extensions : [ '.js' ],
    readFileSync : fs.readFileSync,
    isFile : function (file) {
        return path.existSync(file) && fs.statSync(file).isFile()
    }
}
````

Optionally you can specify a `opts.packageFilter` function to map the contents
of `JSON.parse()`'d package.json files.

If nothing is found, all of the directories in `opts.paths` are searched.

resolve.isCore(pkg)
-------------------

Return whether a package is in core.

Version data entries

3 entries across 3 versions & 2 rubygems

Version Path
snowball-0.1.22 node_modules/browserify/node_modules/resolve/README.markdown
sprockets-browserify-0.1.2 node_modules/browserify/node_modules/resolve/README.markdown
sprockets-browserify-0.1.0 node_modules/browserify/node_modules/resolve/README.markdown