0.1.2 • Published 6 years ago

babel-plugin-implicit-this v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

babel-plugin-implicit-this

Ditch your global variables with this syntactic sugar

Transforms globals to implicit this expressions:

Before:

x = 10;

After:

this.x = 10;

Installation

$ npm install --save-dev babel-plugin-implicit-this

Usage

Via .babelrc (Recommended)

.babelrc

{
  "plugins": ["implicit-this", { "env": "node", "globals": "./path/to/globals.json" }]
}

Via CLI

$ babel --plugins implicit-this script.js

Via Node API

const globals = {
  foo_global: false
}

require("babel-core").transform("code", {
  plugins: ["implicit-this", { env: 'browser', globals }]
});

License

MIT

TODO

  • add const self = this at the top of instance methods
0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.12

6 years ago

0.0.11

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago