Return an array of resolved filepaths or directories for named npm modules. Wildcard (glob) patterns can be used.
Want to see pretty graphs? Log in now!
npm install resolve-dep
|132||downloads in the last day|
|988||downloads in the last week|
|4 962||downloads in the last month|
|Last Published By|
|Version||0.2.0 last updated 3 months ago|
|Keywords||files, glob, grunt config, grunt, lo-dash templates, load, lodash templates, match, minimatch, pattern, require resolve, require, resolve file paths, resolve node module, resolve npm module, resolve paths, resolved filepath|
|Dependencies||chalk, cwd, findup-sync, matchdep, resolve|
|Dependents||assemble, dovetail, grunt-readme, matchkeys|
Return an array of resolved filepaths for named npm module dependencies. Wildcard (glob) patterns can be used.
BREAKING CHANGES IN 0.2.0: Please read the Release History!
Use in node projects (
var load = require('resolve-dep').filter('*')), or filter directly into your project's Grunt config data using templates (
<%= _.load("foo") %>).
Install with npm:
npm i resolve-dep --save
var resolve = require('resolve-dep'); resolve.filter('grunt'); // => ['node_modules/grunt/lib/grunt.js'] resolve.dirname('grunt'); // => ['node_modules/grunt']
// Resolve filepaths for dependencies filter(pattern) // Resolve filepaths for devDependencies filterDev(pattern) // Resolve filepaths for peer dependencies filterPeer(pattern) // Resolve filepaths for all dependencies filterAll(pattern)
Resolve dirnames for dependencies:
// Resolve dirname for dependencies dirname(pattern) // Resolve dirname for devDependencies dirnameDev(pattern) // Resolve dirname for peerDependencies dirnamePeer(pattern) // Resolve dirname for both dependencies and devDependencies dirnameAll(pattern) // => ['node_modules/foo']
// Resolve filepaths to all dependencies from package.json require('resolve-dep').filter('*'); // Resolve filepaths to all devDependencies require('resolve-dep').filterDev('*'); // Resolve filepaths to both dependencies and devDependencies require('resolve-dep').filterAll('*'));
As of v0.2.0, the following methods have been renamed (left = old, right = new):
resolve.dep/ resolve.load: =>
resolve.dev/ resolve.loadDev: =>
resolve.all/ resolve.loadAll: =>
Aliases are still available but will be removed in 0.3.0.
Find a bug? Have a feature request? Please create an Issue.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt, and build the documentation with grunt-readme.
Pull requests are also encouraged, and if you find this project useful please consider "starring" it to show your support! Thanks!
- 2014-01-07 v0.2.0 Refactored completely.
- 2013-09-07 v0.1.0 First commit.
Copyright (c) 2014 Jon Schlinkert, contributors. Released under the MIT license
This file was generated by grunt-readme on Saturday, January 11, 2014.