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

es6-module-transpiler

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-module-transpiler - npm Package Compare versions

Comparing version 0.9.0 to 0.9.1

32

lib/container.js
/* jshint node:true, undef:true, unused:true */
var assert = require('assert');
var Path = require('path');
var Rewriter = require('./rewriter');
var Writer = require('./writer');
var recast = require('recast');

@@ -157,2 +159,32 @@ /** @typedef {{resolveModule: function(string, Module, Container): Module}} */

/**
* Translate and return the contents of this container.
*
* @return {{filename: string, code: string, map: object}[]}
*/
Container.prototype.transform = function() {
if (!this._convertResult) {
this._convertResult = this.convert();
}
var files = this._convertResult;
var codes = [];
files.forEach(function(file) {
var rendered = recast.print(file, {
sourceMapName: Path.basename(file.filename)
});
var code = rendered.code;
var map = rendered.map;
codes.push({
filename: file.filename,
code: code,
map: map
});
});
return codes;
};
/**
* Converts the contents of this container using the current formatter.

@@ -159,0 +191,0 @@ *

2

package.json
{
"name": "es6-module-transpiler",
"version": "0.9.0",
"version": "0.9.1",
"description": "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 various formats.",

@@ -5,0 +5,0 @@ "homepage": "http://esnext.github.io/es6-module-transpiler",

# ES6 Module Transpiler [![Build Status](https://travis-ci.org/esnext/es6-module-transpiler.png)](https://travis-ci.org/esnext/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
JavaScript using a subset of the ES6 module syntax, and compile it into
AMD or CommonJS modules.
**WARNING: The ES6 module syntax is still undergoing a lot of churn, and will
likely change before final approval.**
**ES6 Module Transpiler will track ES6 syntax, and not attempt to maintain
backwards compatibility with syntax that ultimately did not succeed as part of
ES6.**
This compiler provides a way to experiment with ES6 syntax in real world

@@ -40,3 +33,3 @@ scenarios to see how the syntax holds up. It also provides a nicer, more

$ npm install -g es6-module-transpiler
$ compile-modules convert < foo.js
$ compile-modules convert foo.js
```

@@ -71,5 +64,2 @@

Again, this syntax is in flux and is closely tracking the module work being
done by TC39.
### Named Exports

@@ -180,6 +170,6 @@

to write this library. Thanks to [Domenic
Denicola](https://twitter.com/domenic) & [Thomas
Boyt](https://twitter.com/thomasaboyt) for their efforts to make this project
even better. And finally thanks to the JavaScript community at Square for
helping to write and release this library.
Denicola](https://twitter.com/domenic), [Jo Liss](https://twitter.com/jo_liss),
& [Thomas Boyt](https://twitter.com/thomasaboyt) for their efforts to make this
project even better. And finally thanks to the JavaScript community at Square
for helping to write and release this library.

@@ -201,3 +191,3 @@ ## Contributing

When you have a change you'd like to see in the master repository, [send a pull
request](https://github.com/square/es6-module-transpiler/pulls). Before we merge
request](https://github.com/esnext/es6-module-transpiler/pulls). Before we merge
your request, we'll make sure you're in the list of people who have signed a

@@ -204,0 +194,0 @@ CLA.

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