Research
Security News
Threat Actor Exposes Playbook for Exploiting npm to Build Blockchain-Powered Botnets
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
broccoli-es6-npm-compiler
Advanced tools
Broccoli plugin that compiles ES6 modules along with npm dependencies into a single UMD bundle using Browserify. The plugin looks for the jsnext:main
property in your package.json, compiles any ES6 modules to CommonJS modules, browserifies them, and saves the whole thing as single file based on the main
property of the package.json.
For importing npm modules in your ES6 code, use the npm:
prefix. For instance, if you wanted to use the RSVP promise library, you would import it like so:
import npmModule from 'npm:rsvp';
// Use regular syntax for local modules
import myLocalModule from './lib/my-local-module';
This prefix, as well as the entire plugin, was inspired by ember-browserify.
Let's say your package.json looks something like this:
// package.json
{
"name": "MyModule",
"main": "exports/my-module.js",
"jsnext:main": "lib/index.js",
//...
}
Now just add this to your Brocfile:
//Brocfile.js
var compileEs6 = require('broccoli-es6-npm-compiler');
var options = {
globalName: 'MyLibrary',
amdModuleId: 'MyLibrary'
};
var outputTree = compileEs6(options);
Yea, it's that simple. Using lib/index.js
as the root ES6 module, the plugin will bundle your ES6 code into a file named my-module.js
in the dist output folder when you run Broccoli.
globalName - Name of global module variable exported via UMD. In other words, window[globalName]. Defaults to name
in package.json
.
amdModuleId - Module ID of exported AMD module. If undefined, AMD module will be anonymous.
FAQs
Compile ES6 modules along with npm dependencies
The npm package broccoli-es6-npm-compiler receives a total of 1 weekly downloads. As such, broccoli-es6-npm-compiler popularity was classified as not popular.
We found that broccoli-es6-npm-compiler 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.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.