load-plugins
Load plugins for gulp, grunt, assemble, verb any node.js app that needs to load plugins from node_modules or local folders.
Last updated 10 years ago by jonschlinkert .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install load-plugins 
SYNC missed versions from official npm registry.

load-plugins NPM version Build Status

Load plugins for gulp, grunt, assemble, verb any node.js app that needs to load plugins from node_modules or local folders.

Install

Install with npm

$ npm i load-plugins --save

Usage

with gulp

var plugin = require('load-plugins')('gulp-*');

gulp.task('default', function () {
  gulp.src('test/*.js')
    .pipe(plugin.jshint());
    .pipe(plugin.mocha());
});

with assemble

var plugin = require('load-plugins')('assemble-*');

assemble.task('default', function () {
  assemble.src('templates/*.hbs')
    .pipe(plugin.paginate());
    .pipe(plugin.collections());
    .pipe(assemble.dest('dist/'));
});

with verb

var plugin = require('load-plugins')('verb-*');

verb.task('default', function () {
  verb.src('docs/*.md')
    .pipe(plugin.toc());
    .pipe(plugin.reflinks());
    .pipe(verb.dest('./'));
});

Options

See resolve-dep for additional options.

options.require

Pass a custom function for requireing files.

plugins('gulp-*', {
  require: function(filepath) {
    // do stuff to filepath
  }
});

options.camelize

Make plugin names camelcased. By default this is true.

options.rename

Pass a rename function to change how plugins are named.

plugins('my-plugins-*', {
  rename: function (filepath) {
    return path.basename(filepath);
  }
});

options.strip

Omit strings from plugin names. This is a complement to the .rename() option, it's easiest to understand by way of example:

plugins('gulp-*', {strip: 'gulp'});

Returns {mocha: [Function]} instead of {'gulp-mocha': [Function]}, and so on.

You may also pass an array of strings to strip, or use braces, e.g.:

// note that the `strip` option doesn't work with full glob patterns, just braces
plugins('{foo,bar}-*', {strip: ['foo', 'bar']});

Related

Running tests

Install dev dependencies:

$ npm i -d && npm test

Contributing

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

Author

Jon Schlinkert

License

Copyright © 2014-2015 Jon Schlinkert Released under the MIT license.


This file was generated by verb-cli on July 05, 2015.

Current Tags

  • 2.1.2                                ...           latest (8 years ago)

16 Versions

  • 2.1.2                                ...           8 years ago
  • 2.1.1                                ...           8 years ago
  • 2.1.0                                ...           9 years ago
  • 2.0.1                                ...           9 years ago
  • 2.0.0                                ...           9 years ago
  • 1.0.2                                ...           9 years ago
  • 1.0.1                                ...           10 years ago
  • 1.0.0                                ...           10 years ago
  • 0.3.0                                ...           10 years ago
  • 0.2.4                                ...           10 years ago
  • 0.2.3                                ...           10 years ago
  • 0.2.2                                ...           10 years ago
  • 0.2.0                                ...           10 years ago
  • 0.1.2                                ...           10 years ago
  • 0.1.1                                ...           10 years ago
  • 0.1.0                                ...           10 years ago
Maintainers (1)
Downloads
Total 0
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (9)
Dependents (1)

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