# broccoli-load-plugins

> Automatically load any broccoli plugins in your package.json

Latest version **0.1.0** (published 2014-02-18) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install broccoli-load-plugins
pnpm add broccoli-load-plugins
yarn add broccoli-load-plugins
bun add broccoli-load-plugins
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2014-02-18 |
| First published | 2014-02-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Jason Sandmeyer |
| Maintainers | jas |
| Keywords | broccoliplugin, broccoli-plugin, broccoli, plugin, load, autoload, automatic |

## Links

- npm: https://www.npmjs.com/package/broccoli-load-plugins
- Repository: https://github.com/jas/broccoli-load-plugins
- Issues: https://github.com/jas/broccoli-load-plugins/issues
- npm.io page: https://npm.io/package/broccoli-load-plugins

## Dependencies (2)

- [globule](https://npm.io/package/globule.md) ~0.1.0
- [findup-sync](https://npm.io/package/findup-sync.md) ~0.1.2

## Recent versions

- 0.1.0 (latest) — 2014-02-18

## README

# broccoli-load-plugins [![Build Status](https://travis-ci.org/jas/broccoli-load-plugins.png)](https://travis-ci.org/jas/broccoli-load-plugins)

Automatically loads broccoli plugins and attaches them to an object of your choice or the global scope.

## Usage

```
$ npm install broccoli-load-plugins --save-dev
```

Given a `package.json` file that has some dependencies within:

```json
{
  "dependencies": {
    "broccoli-static-compiler": "*",
    "broccoli-uglify-js": "*",
    "broccoli-template": "*"
  }
}
```

Adding this into your `Broccolifile.js`:

```js
var broccoliLoadPlugins = require('broccoli-load-plugins');
var plugins = broccoliLoadPlugins();
```

Or, even shorter:

```js
var plugins = require('broccoli-load-plugins')();
```

Will result in the following happening:

```js
plugins.staticCompiler = require('broccoli-static-compiler');
plugins.uglifyJs = require('broccoli-uglify-js');
plugins.template = require('broccoli-template');
```

You can then use the plugins just like you would if you'd manually required them, but by referring to them as `plugins.name()`, rather than just `name()`.

This frees you up from having to manually require each broccoli plugin.

## Options

You can pass in an object of options (the shown options are the defaults):

```js
broccoliLoadPlugins({
  // the glob to search for
  pattern: 'broccoli-*',

  // where to find the plugins
  config: 'package.json',

  // which keys in the config to look within
  scope: ['dependencies', 'devDependencies', 'peerDependencies'],

  // what to remove from the name of the module when adding it to the context
  replaceString: 'broccoli-',

  // if true, transforms hyphenated plugins names to camel case
  camelize: true
});
```

## Credit

Credit largely goes to [@jackfranklin](https://github.com/jackfranklin) for his [gulp-load-plugins](https://github.com/jackfranklin/gulp-load-plugins) module. This module is almost identical, just tweaked slightly to work with Broccoli.

---
_Source: https://npm.io/package/broccoli-load-plugins · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
