Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
broccoli-load-plugins
Advanced tools
Automatically loads broccoli plugins and attaches them to an object of your choice or the global scope.
$ npm install broccoli-load-plugins --save-dev
Given a package.json
file that has some dependencies within:
{
"dependencies": {
"broccoli-static-compiler": "*",
"broccoli-uglify-js": "*",
"broccoli-template": "*"
}
}
Adding this into your Broccolifile.js
:
var broccoliLoadPlugins = require('broccoli-load-plugins');
var plugins = broccoliLoadPlugins();
Or, even shorter:
var plugins = require('broccoli-load-plugins')();
Will result in the following happening:
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.
You can pass in an object of options (the shown options are the defaults):
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 largely goes to @jackfranklin for his gulp-load-plugins module. This module is almost identical, just tweaked slightly to work with Broccoli.
FAQs
Automatically load any broccoli plugins in your package.json
The npm package broccoli-load-plugins receives a total of 2 weekly downloads. As such, broccoli-load-plugins popularity was classified as not popular.
We found that broccoli-load-plugins 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.