Security News
CISA Brings KEV Data to GitHub
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
broccoli-cjs-wrap
Advanced tools
Wrap naked CommonJS modules in a define
wrapper for use in browser.
npm install --save-dev broccoli-cjs-wrap
var cjsWrap = require('broccoli-cjs-wrap');
var filterEs6Module = require('broccoli-es6-module-filter');
var pickFiles = require('broccoli-static-compiler');
var mergeTrees = require('broccoli-merge-trees');
module.exports = function (broccoli) {
// in conjunction with es6 module filter
var tree = broccoli.makeTree('lib');
// create a CJS version
var cjsTree = filterEs6Module(pickFiles(tree, {
srcDir: '',
destDir: 'cjs'
}));
var wrappedCjsTree = cjsWrap(pickFiles(cjsTree, {
srcDir: '',
destDir: 'cjs-wrapped'
}));
return mergeTrees([cjsTree, wrappedCjsTree]);
};
To build:
$ broccoli build output
namespace
- Namespace all your modules. ex: 'MyApp', MyApp/tracker
packageName
- Name of your package, goes after the namespace.main
- main entry point of the module. ex: 'index', MyApp/tracker/index.js
-> MyApp/tracker
. You must pass a packageName
and/or namespace
if you use main
require
- Require function that define
is attached to. Defaults to this.require
FAQs
broccoli filter for wrapping CommonJS modules
The npm package broccoli-cjs-wrap receives a total of 20 weekly downloads. As such, broccoli-cjs-wrap popularity was classified as not popular.
We found that broccoli-cjs-wrap 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
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.
Security News
Opengrep forks Semgrep to preserve open source SAST in response to controversial licensing changes.
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.