resolve-dep
Return an array of resolved filepaths for specified npm module dependencies. Minimatch patterns can be used. Lo-Dash templates can be used to load filepaths into Grunt config.
Last updated 11 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install resolve-dep 
SYNC missed versions from official npm registry.

resolve-dep NPM version NPM monthly downloads NPM total downloads Linux Build Status

Return an array of resolved filepaths for require-able local or named npm modules. Wildcard (glob) patterns may be used.

Install

Install with npm:

$ npm install --save resolve-dep

Usage

Similar in concept to matchdep and load-grunt-tasks, but returns an array of fully resolved file paths to any local modules or npm modules listed in package.json dependencies.

var resolve = require('resolve-dep');
resolve( patterns, options )

patterns

Type: string|array

The file path, glob pattern, or name of the npm module to resolve.

File paths

resolve('templates/*.hbs')
resolve(['a/*.hbs', 'b/*.hbs'])

NPM modules

resolve('*')
resolve(['grunt-*', 'gulp-*'])
resolve(['grunt-*', 'gulp-*'], {type: 'devDependencies'})
resolve(['lodash', 'assemble']);

Options

Type: object

The options object supports any globby options, as well as the following:

options.config

Type: Object Default value: package.json

Pass an explicit config object to use instead of package.json.

options.type

Type: String|Array

Default value: all

Valid values: all|dependencies|devDepencies|peerDependencies

Any valid npm dependency field that can be used in package.json is a valid value for this option.

Examples:

// resolve chai and mocha, if in devDependencies, otherwise an empty array
resolve(['chai', 'mocha'], {type: 'devDependencies'});
// resolve lodash if in dependencies, otherwise an empty array
resolve(['lodash'], {type: 'dependencies'});
// all dependencies
resolve(['*'], {type: 'dependencies'});
// all dependencies, devDependencies and peerDependencies
resolve('*');

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Contributors

Commits Contributor
36 jonschlinkert
4 tunnckoCore
2 TrySound
2 doowb
1 jaridmargolin

Building docs

(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:

$ npm install -g verb verb-generate-readme && verb

Running tests

Install dev dependencies:

$ npm install -d && npm test

Author

Jon Schlinkert

License

Copyright © 2016, Jon Schlinkert. Released under the MIT license.


This file was generated by verb-generate-readme, v0.2.0, on December 10, 2016.

Current Tags

  • 0.6.0                                ...           latest (8 years ago)

20 Versions

  • 0.6.0                                ...           8 years ago
  • 0.5.4                                ...           8 years ago
  • 0.5.3                                ...           10 years ago
  • 0.5.2                                ...           10 years ago
  • 0.5.1                                ...           10 years ago
  • 0.5.0                                ...           10 years ago
  • 0.4.1                                ...           10 years ago
  • 0.4.0                                ...           10 years ago
  • 0.3.11                                ...           10 years ago
  • 0.3.5                                ...           11 years ago
  • 0.3.4                                ...           11 years ago
  • 0.3.3                                ...           11 years ago
  • 0.3.2                                ...           11 years ago
  • 0.3.1                                ...           11 years ago
  • 0.3.0                                ...           11 years ago
  • 0.2.0                                ...           11 years ago
  • 0.1.3                                ...           11 years ago
  • 0.1.2                                ...           11 years ago
  • 0.1.1                                ...           11 years ago
  • 0.1.0                                ...           11 years ago
Maintainers (1)
Downloads
Total 1
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (3)

© 2010 - cnpmjs.org x YWFE | Home | YWFE