New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

intergenerator

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

intergenerator

Code and source-map generator for Babel AST.

latest
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

intergenerator

intergenerator is a code and source-map generator for Babel AST. For specifically, in only generates minified code. This, along with a handful of other trade-offs, has allowed for improved performance characteristics compared to babel-generator itself.

At present, this library only supports ES5 code. An error will be thrown if any unexpected node types are encountered.

More AST node types will be supported in the future. If you don't see an issue related to an unimplemented node type, please feel free to open one. Or even better, open a PR!

intergenerator is a subproject of Interlock. For information about Interlock and how it works, check out our website.

Usage

// Instantiate a new generator...
const g = new Generator({
  // options
});

// Add all source files...
g.addSourceFile("source-file-a.js", sourceContentA);
g.addSourceFile("source-file-b.js", sourceContentB)

// Generate code from your AST...
g.generate(ast);

// And retrieve your code and source-map.
const { code, map } = g;

Options

  • sourceRoot: Optional. The URL root from which all sources are relative.
  • outputFilename: Optional. The generated filename the source map is associated with.
  • includeSourcemap: Boolean. Determines whether a source-map is generated.

Note: Performance is roughly 3x slower at present with source-map generation enabled.

License

MIT License

FAQs

Package last updated on 26 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts