Socket
Socket
Sign inDemoInstall

es6-module-crosspiler

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-module-crosspiler - npm Package Compare versions

Comparing version 0.0.0 to 0.0.2

13

lib/exports.js

@@ -27,4 +27,4 @@

if (node.default) {
if (declaration.type !== 'Identifier') throw new Error('wtf')
exports.push([declaration.name, 'default'])
var id = node._varname = this.sourceToVariableName('default')
exports.push([id, 'default'])
return

@@ -60,3 +60,3 @@ }

throw new Error('wtf')
})
}, this)

@@ -77,3 +77,8 @@ if (!exports.length) return // nothing to export

// remove `export default`s
path.replace()
path.replace(b.variableDeclaration('var', [
b.variableDeclarator(
b.identifier(path.node._varname),
path.node.declaration
)
]))
} else if (path.node.specifiers) {

@@ -80,0 +85,0 @@ // remove `export { x, y }`s

@@ -20,2 +20,15 @@

Module.prototype.inspect = function () {
return this.toJSON()
}
Module.prototype.toJSON = function () {
return {
type: this.type,
default: this.default,
dependencies: this.dependencies,
renames: this.renames,
}
}
Module.prototype.rename = function (from, to) {

@@ -22,0 +35,0 @@ this.renames[from] = to

{
"name": "es6-module-crosspiler",
"description": "An ES6 and CommonJS cross-compatible transpiler",
"version": "0.0.0",
"version": "0.0.2",
"author": {

@@ -38,3 +38,5 @@ "name": "Jonathan Ong",

"main": "lib",
"files": ["lib"]
"files": [
"lib"
]
}

@@ -209,2 +209,6 @@

#### .requires[]
Get the raw AST `require()` nodes.
#### .renameRequires()

@@ -211,0 +215,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