Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
simbo committed Dec 23, 2014
1 parent 2b5f4e5 commit 573a43b
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
auto-plug
=========

> Auto-require plugins packages by prefix. (for i.e. Gulp, Grunt or other
> Auto-require plugins packages by prefix. (for i.e. [Gulp](https://github.com/gulpjs/gulp), [Grunt](https://github.com/gruntjs/grunt) or other
> heavy plugin-dependant packages)
[![npm Package Version](https://img.shields.io/npm/v/auto-plug.svg?style=flat-square)](https://www.npmjs.com/package/auto-plug)
Expand All @@ -22,12 +22,12 @@ $ npm install auto-plug

## Usage

***auto-plug*** will return a object containing the required module exports. If your config data contains package names like `foo-this` and `foo-that`, they can be autoloaded by passing the prefix `foo` and after that accessed by `plugins.this()`or `plugins.that()`.
***auto-plug*** will return a object containing the required module exports. If your config data contains package names like `foo-this` and `foo-that`, they can be auto-loaded by `plugins = require('auto-load')('foo')` and then accessed by `plugins.this()`or `plugins.that()`.

You can do this:

``` javascript
var plugins = require('auto-plug')('myprefix');
var plugins = require('auto-plug')('foo');
```

or that:
Expand Down Expand Up @@ -93,6 +93,16 @@ var metalsmith = require('metalsmith')
```


### Tip

If you already loaded your package.json's data, pass it as config option to speed up things:

``` javascript
var pkg = require(process.cwd() + '/package.json'),
plugins = require('auo-plug')({ prefix: 'foo', config: pkg });
```


## Options

All options are optional.
Expand Down

0 comments on commit 573a43b

Please # to comment.