babel-plugin-javascript

1.0.0 • Public • Published

babel-plugin-javascript

This plugin will allow you to import all globals using js modules. Thanks to that you will stop using non-explicit variables.

Example

In

import JavaScript from 'javascript';
import { Object } from 'javascript';
import Math from 'javascript/Math';
import { abs } from 'javascript/Math';
 
JavaScript.window;
new Object();
Math.round();
abs();

Out

self.window;
new self.Object();
self.Math.round();
self.Math.abs();

Installation

$ npm install babel-plugin-javascript

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["javascript"]
}

Via CLI

$ babel --plugins javascript script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["javascript"]
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.0
    1
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.0
    1
  • 0.1.1
    0
  • 0.1.0
    0

Package Sidebar

Install

npm i babel-plugin-javascript

Weekly Downloads

1

Version

1.0.0

License

none

Unpacked Size

13 kB

Total Files

5

Last publish

Collaborators

  • exelord