Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-es6-module-transpiler

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-es6-module-transpiler

Broccoli plugin for Square's ES6 Module Transpiler

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
decreased by-79.41%
Maintainers
1
Weekly downloads
 
Created
Source

Broccoli's ES6 Module Transpiler

Usage

Transpiling to AMD:

var transpileES6 = require('broccoli-es6-module-transpiler');

var transpiledLib = transpileES6(lib, {
  moduleName: function(filePath) {
    return filePath.replace(/.js$/, '');
  }
});

Transpiling to CommonJS:

var transpileES6 = require('broccoli-es6-module-transpiler');

var transpiledLib = transpileES6(lib, {
  type: 'cjs'
});

Documentation

transpileES6(inputTree, options)


options.type {String}

The type of module to transpile to.

Possible values: amd, cjs, yui or globals. Default: amd.


options.moduleName {Function, String, true, null}

The module name that is passed to the transpiler for each file.

  • If moduleName is null an anonymous module will be generated.
  • If moduleName is a string it will be passed directly the transpiler for all files.
  • If moduleName is a function it will be called with the path of the current file as its sole argument. The return value of the function will be passed to the transpiler.
  • If moduleName is true the filename will be used (after stripping the last three characters).

Default: null.


options.transpilerOptions {Function, Object, null}

The options that are passed to the transpiler for each file.

  • If transpilerOptions is null no options will be passed.
  • If transpilerOptions is an object it will be passed directly the transpiler for all files.
  • If transpilerOptions is a function it will be called with the path of the current file as its sole argument. The return value of the function will be passed to the transpiler.

Default: null.

Keywords

FAQs

Package last updated on 18 Apr 2014

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc