
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
es6-module-transpiler-brunch
Advanced tools
Adds ES6 module syntax to Brunch based on Square's es6-module-transpiler.
ES6 Module Transpiler is an experimental compiler that allows you to write your JavaScript using a subset of the current ES6 module syntax, and compile it into AMD or CommonJS modules.
Install the plugin via npm with npm install --save es6-module-transpiler-brunch.
Or, do manual install:
"es6-module-transpiler-brunch": "x.y.z" to package.json of your brunch app."es6-module-transpiler-brunch": "git+ssh://git@github.com:gcollazo/es6-module-transpiler-brunch.git".Again, this syntax is in flux and is closely tracking the module work being done by TC39.
There are two types of exports. Named exports like the following:
// foobar.js
var foo = "foo", bar = "bar";
export { foo, bar };
This module has two named exports, foo and bar.
You can also write this form as:
// foobar.js
export var foo = "foo";
export var bar = "bar";
Either way, another module can then import your exports like so:"
import { foo, bar } from "foobar";
console.log(foo); // "foo"
You can also export a default export. For example, an ES6ified jQuery might look like this:
// jquery.js
var jQuery = function() {};
jQuery.prototype = {
// ...
};
export default = jQuery;
Then, an app that uses jQuery could import it with:
import $ from "jquery";
The default export of the "jquery" module is now aliased to $.
A default export makes the most sense as a module's "main" export, like the
jQuery object in jQuery. You can use default and named exports in parallel.
moduleWhereas the import keyword imports specific identifiers from a module,
the module keyword creates an object that contains all of a module's
exports:
module foobar from "foobar";
console.log(foobar.foo); // "foo"
In ES6, this created object is read-only, so don't treat it like a mutable namespace!
import "foo";A "bare import" that doesn't import any identifiers is useful for executing side effects in a module. For example:
// alerter.js
alert("alert! alert!");
// alertee.js
import "alerter"; // will pop up alert box
The plugin will take all files ending in *.js under the app directory and pass them through the es6-module-transpiler and compiled as CommonJS modules.
The plugin has two configuration options you can add to your project's config.coffee: match which is a regex used to decide what files to compile and debug which will console.log debugging info when the plugin runs.
exports.config =
es6ModuleTranspiler:
match: /^app/
debug: yes
FAQs
Brunch plugin for es6-module-transpiler
We found that es6-module-transpiler-brunch 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.

Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.

Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.

Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.