
Product
Socket for Jira Is Now Available
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.
List and load dependencies.
Based on https://github.com/jackfranklin/gulp-load-plugins.
Returns an array of dependency names.
| argument | type | default | description |
|---|---|---|---|
| scope | array | ['dependencies', 'devDependencies', 'peerDependencies'] | list of dependency types |
| config | string or object | 'package.json' | path to package.json file or custom config object |
var deps = ldep.list(['dependencies']);
var deps = ldep.list(['devDependencies'], './package.json');
Attaches dependency names to a single variable. Dependencies are lazy loaded only when the dependency name is accessed.
| argument | type | description |
|---|---|---|
| deps | array | list of dependency names |
| rename | function | function to customize name of each dependency. Takes 2 arguments - name of dependency and camelize function (which converts gulp-plugin to gulpPlugin) - and returns the modified name |
var deps = ldep.list();
var $ = ldep.load(deps);
// or simply
var $ = ldep.load(ldep.list());
// now instead of doing this
var moduleName = require('module-name');
// use it like this
$.moduleName // moduleName is loaded now
var $ = ldep.load(ldep.list(['devDependencies'])), function(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
});
This is a wrapper for multimatch implemented as multimatch(deps, match).
| argument | type |
|---|---|
| match | string or array |
| deps | array |
var deps = ldep.list();
// get only gulp plugins
var gulpPlugins = ldep.like('gulp-*', deps);
// or simply
var gulpPlugins = ldep.like('gulp-*', ldep.list());
// get only grunt plugins
var gruntPlugins = ldep.like('grunt-contrib-*', ldep.list());
npm install ldep
var ldep = require('ldep');
// load gulp plugins and rename them by removing 'gulp-' prefix and camelizing
var $ = ldep.load(ldep.like('gulp-*', ldep.list()), function(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
});
// load gulp plugins only from devDependencies
var $ = ldep.load(ldep.like('gulp-*', ldep.list(['devDependencies'])), function(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
});
// or
var deps = ldep.list(['devDependencies']);
var gulpPlugins = ldep.like('gulp-*', deps);
function renameGulpPlugins(name, camelize) {
return camelize(name.replace(/^gulp\-/, ''));
}
var plugins = ldep.load(gulpPlugins, renameGulpPlugins);
FAQs
List and load dependencies.
We found that ldep demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Product
Socket for Jira lets teams turn alerts into Jira tickets with manual creation, automated ticketing rules, and two-way sync.

Company News
Socket won two 2026 Reppy Awards from RepVue, ranking in the top 5% of all sales orgs. AE Alexandra Lister shares what it's like to grow a sales career here.

Security News
NIST will stop enriching most CVEs under a new risk-based model, narrowing the NVD's scope as vulnerability submissions continue to surge.