Socket
Socket
Sign inDemoInstall

6to5

Package Overview
Dependencies
9
Maintainers
1
Versions
257
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.5 to 0.0.7

bin/6to5-node

14

lib/6to5/node.js

@@ -8,14 +8,4 @@ var transform = require("./transform");

exports.register = function (includeNodeModules) {
var old = require.extensions[".js"];
require.extensions[".js"] = function (m, filename) {
if (!includeNodeModules && filename.indexOf("node_modules") >= 0) {
return old.apply(this, arugments);
}
m._compile(exports.transformFileSync(filename, {
sourceMap: true
}), filename);
};
exports.register = function () {
require("./register");
};

@@ -22,0 +12,0 @@

@@ -88,6 +88,6 @@ var estraverse = require("estraverse");

return function (name) {
var i = ids[name] || 0;
var i = ids[name] || 1;
var id = "_" + name;
if (i > 0) id += i;
if (i > 1) id += i;
ids[name] = i + 1;

@@ -151,16 +151,8 @@ return id;

var normaliseNode = function (node) {
if (!keepExpression && node.type === "ExpressionStatement") {
return node.expression;
} else {
return node;
}
};
var node = template.body[0];
var body = template.body;
if (body.length <= 1) {
return normaliseNode(body[0]);
if (!keepExpression && node.type === "ExpressionStatement") {
return node.expression;
} else {
return body.map(normaliseNode);
return node;
}

@@ -170,4 +162,2 @@ };

exports.codeFrame = function (lines, lineNumber, colNumber) {
if (!lineNumber) return "";
colNumber = Math.max(colNumber, 0);

@@ -174,0 +164,0 @@

{
"name": "6to5",
"description": "Turn ES6 code into vanilla ES5 with no runtime required",
"version": "0.0.5",
"version": "0.0.7",
"repository": {

@@ -15,3 +15,4 @@ "type": "git",

"bin": {
"6to5": "./bin/6to5"
"6to5": "./bin/6to5",
"6to5-node": "./bin/6to5-node"
},

@@ -18,0 +19,0 @@ "scripts": {

@@ -74,2 +74,16 @@ <p align="center">

#### Node
Launch a repl.
$ 6to5-node
Evaluate code.
$ 6to5-node -e "class Test { }"
Compile and run `test.js`.
$ 6to5-node test
### Browserify

@@ -76,0 +90,0 @@

@@ -1,1 +0,1 @@

require("6to5").register();
require("./lib/6to5/register");

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc