https://github.com/supreetpal/babel-plugin-boilerplate
A setup to get you started on building babel plugins.
https://github.com/supreetpal/babel-plugin-boilerplate
Last synced: about 1 month ago
JSON representation
A setup to get you started on building babel plugins.
- Host: GitHub
- URL: https://github.com/supreetpal/babel-plugin-boilerplate
- Owner: supreetpal
- License: mit
- Created: 2016-05-22T21:23:57.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2018-04-19T02:51:30.000Z (almost 8 years ago)
- Last Synced: 2025-04-03T10:51:23.263Z (about 1 year ago)
- Language: JavaScript
- Size: 14.6 KB
- Stars: 44
- Watchers: 1
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome_frontend_development_resources - babel-plugin-boilerplate - A setup to get you started on building babel plugins. (Boilerplate / React Components)
- awesome - babel-plugin-boilerplate - A setup to get you started on building babel plugins. (Boilerplate / React Components)
README
Read babel plugin handbook -> https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md
Try http://astexplorer.net/#/Pcw9baefXI for a visual understanding.
# babel-plugin-boilerplate
Add a description for the plugin here
## Example
**In**
```js
let tips = [
"Paste or drop some JavaScript here and explore the syntax tree created by chosen parser.",
"You can use all the cool new features from ES6 and even more. Enjoy!"
];
function printTips() {
tips.forEach((tip, i) => console.log(`Tip ${i}:` + tip));
}
```
**Out**
```js
let spit = ["Paste or drop some JavaScript here and explore the syntax tree created by chosen parser.", "You can use all the cool new features from ES6 and even more. Enjoy!"];
function spiTtnirp() {
spit.hcaErof((pit, i) => elosnoc.gol(`Tip ${ i }:` + pit));
}
```
## Installation
```sh
$ npm install babel-plugin-boilerplate
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["boilerplate"]
}
```
### Via CLI
```sh
$ babel --plugins boilerplate script.js
```
### Via Node API
```javascript
require("babel-core").transform("code", {
plugins: ["boilerplate"]
});
```