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

babelify

Package Overview
Dependencies
Maintainers
2
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babelify - npm Package Compare versions

Comparing version 6.3.0 to 6.4.0

5

index.js

@@ -17,2 +17,3 @@ var assign = require("object-assign");

this._data = "";
this._filename = filename;
this._opts = assign({filename: filename}, opts);

@@ -28,3 +29,5 @@ }

try {
var code = babel.transform(this._data, this._opts).code;
var result = babel.transform(this._data, this._opts);
this.emit("babelify", result, this._filename);
var code = result.code;
this.push(code);

@@ -31,0 +34,0 @@ } catch(err) {

6

package.json
{
"name": "babelify",
"description": "Babel browserify transform",
"version": "6.3.0",
"version": "6.4.0",
"author": "Sebastian McKenzie <sebmck@gmail.com>",

@@ -17,3 +17,3 @@ "license": "MIT",

"babel-core": "^5.0.0",
"object-assign": "^3.0.0"
"object-assign": "^4.0.0"
},

@@ -23,3 +23,3 @@ "devDependencies": {

"convert-source-map": "^1.1.0",
"tap": "^1.0.2"
"tap": "^2.1.1"
},

@@ -26,0 +26,0 @@ "scripts": {

@@ -136,2 +136,21 @@ # babelify

#### Babel result: metadata and others
Babelify emits a `babelify` event with Babel's full result object as the first
argument, and the filename as the second. Browserify doesn't pass-through the
events emitted by a transform, so it's necessary to get a reference to the
transform instance before you can attach a listener for the event:
```js
var b = browserify().transform(babelify);
b.on('transform', function(tr) {
if (tr instanceof babelify) {
tr.once('babelify', function(result, filename) {
result; // => { code, map, ast, metadata }
});
}
});
```
## FAQ

@@ -138,0 +157,0 @@

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