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

babel-plugin-chevrotain-serialize

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-chevrotain-serialize

This plugin finds class declarations which inherit from `chevrotain.Parser`, serializes them, and passes this serialization into their constructor `super` calls, allowing your code to bypass parser grammar construction at runtime. This is especially usefu

  • 0.1.0-alpha
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by50%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-serialize-chevrotain-parsers

This plugin finds class declarations which inherit from chevrotain.Parser, serializes them, and passes this serialization into their constructor super calls, allowing your code to bypass parser grammar construction at runtime. This is especially useful if you run your code through a minifier, as you’ll no longer have to avoid mangling token names.

Installation

npm install --save-dev babel-plugin-serialize-chevrotain-parsers

or

yarn add --dev babel-plugin-serialize-chevrotain-parsers

Usage

Add the plugin to your .babelrc.

{
  "plugins": ["babel-plugin-serialize-chevrotain-parsers"]
}

The plugin will find Parser references which are imported and referenced in one of four ways.

// method 1
import { Parser } from "chevrotain";
// method 2
const { Parser } = require("chevrotain");
// method 1 & 2 reference
class MyParser extends Parser {
}
// method 3
import * as chevrotain from "chevrotain";
// method 4
const chevrotain = require("chevrotain");
// method 3 & 4 reference
class MyParser extends chevrotain.Parser {
}
// will not work
const Parser1 = Parser;
// this will not be detected
class MyParser extends Parser1 {
}

FAQs

Package last updated on 15 Jun 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