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

lazy-babylon-to-estree

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lazy-babylon-to-estree

Lazily transform a Babylon AST into an ESTree AST. Only transforms nodes that are accessed

  • 1.1.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

lazy-babylon-to-estree

CircleCI

WIP: Lazily "convert" a Babylon AST to the ESTree equivalent. Currently only converts Literals. For the time being, the goal of this project is only to support the bare minimum transformations needed by webpack.

Features

  • Conversions happen lazily when a property on the AST is accessed
  • Original AST is not mutated (besides 1 non-enumerable, symbol-keyed prop on the Program node)
  • Referential Equality between nodes is maintained (===)
  • Transformations occur as other code traverses the tree (this module does not perform a separate traversal of the AST)

Why?

This is an experiment I'm doing with webpack and babel-loader to try and prevent the double parsing of code, without having to create an entire transformed copy of the AST each time we go from babel-loader >> webpack. It's possible this will have no positive performance impact (or will even have a negative perf impact), but I'd never know if I didn't write the code 🕺.

Missing Features/TODO

  • ObjectProperty and ObjectMethod >> Property
  • ClassMethod >> MethodDefinition

Keywords

FAQs

Package last updated on 04 Jan 2018

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

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