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

esnext

Package Overview
Dependencies
Maintainers
1
Versions
116
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esnext - npm Package Compare versions

Comparing version 0.2.0 to 0.3.0

test/examples/templates.js

20

lib/index.js
var fs = require('fs');
var through = require('through');
var es6templates = require('es6-templates');
var es6arrowfn = require('es6-arrow-function');

@@ -57,2 +59,6 @@ var es6class = require('es6-class');

if (options.templates !== false) {
ast = es6templates.transform(ast);
}
if (options.arrowFunction !== false) {

@@ -110,2 +116,14 @@ ast = es6arrowfn.transform(ast);

exports.compile = compile;
module.exports = function () {
var data = '';
return through(write, end);
function write (buf) { data += buf; }
function end () {
this.queue(module.exports.compile(data).code);
this.queue(null);
}
};
module.exports.compile = compile;
module.exports.transform = transform;

7

package.json
{
"name": "esnext",
"version": "0.2.0",
"version": "0.3.0",
"description": "Transform next-generation JavaScript to today's JavaScript.",

@@ -30,4 +30,7 @@ "main": "lib/index.js",

"esprima": "git://github.com/ariya/esprima.git#harmony",
"recast": "^0.5.14"
"recast": "^0.5.14",
"through": "^2.3.4",
"es6-templates": "^0.0.2",
"ast-types": "^0.3.23"
}
}

@@ -33,2 +33,3 @@ # esnext

* arrow functions (via [es6-arrow-function][es6-arrow-function])
* template strings (via [es6-templates][es6-templates])

@@ -44,6 +45,6 @@ ### TODO

Any omissions here are not intentional and we'd love to integrate support for
more future JavaScript syntax. See the Contributing section below. Keep in mind
that, as of right now, this project is intended to support new JavaScript
*syntax* only. Any new APIs should be handled using polyfills. This may change
in the future.
more future JavaScript syntax (see [es6features][es6features] for a more
complete list). See the Contributing section below. Keep in mind that, as of
right now, this project is intended to support new JavaScript *syntax* only.
Any new APIs should be handled using polyfills. This may change in the future.

@@ -107,2 +108,4 @@ ## Usage

[es6-module-transpiler]: https://github.com/square/es6-module-transpiler
[es6-templates]: https://github.com/square/es6-templates
[es6features]: https://github.com/lukehoban/es6features
[recast]: https://github.com/benjamn/recast

@@ -109,0 +112,0 @@ [regenerator]: http://facebook.github.io/regenerator/

@@ -19,2 +19,6 @@ /* jshint esnext:true */

}
toString() {
return `[Counter count=${this.count}]`;
}
}

@@ -44,1 +48,2 @@

assert.equal(counter.count, 13);
assert.equal(counter.toString(), '[Counter count=13]');
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