0.1.2 • Published 7 years ago

babel-plugin-implicit-this v0.1.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 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

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.12

8 years ago

0.0.11

8 years ago

0.0.10

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago