babel-plugin-transform-eval

Compile eval calls with string literals

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
babel-plugin-transform-eval
6.22.06 years ago7 years agoMinified + gzip package size for babel-plugin-transform-eval in KB

Readme

babel-plugin-transform-eval
Compile eval calls with string literals

Example

In
eval("(() => 'foo')");

Out
eval("(function () { return 'foo'; })");

Installation

$ npm install babel-plugin-transform-eval

Usage

Via .babelrc (Recommended)

.babelrc
{
  "plugins": ["transform-eval"]
}

Via CLI

$ babel --plugins transform-eval script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["transform-eval"]
});