Skip to content

Commit c0b55b9

Browse files
committed
updated readme
1 parent d758b21 commit c0b55b9

File tree

1 file changed

+16
-29
lines changed

1 file changed

+16
-29
lines changed

README.md

+16-29
Original file line numberDiff line numberDiff line change
@@ -37,51 +37,38 @@ grunt.initConfig({
3737

3838
### Options
3939

40-
#### options.separator
41-
Type: `String`
42-
Default value: `', '`
40+
#### options.visitors
41+
Type: `Array`
42+
Default value: `[]`
4343

44-
A string value that is used to do something with whatever.
45-
46-
#### options.punctuation
47-
Type: `String`
48-
Default value: `'.'`
49-
50-
A string value that is used to do something else with whatever else.
44+
A list of visitors to apply when transpiling.
5145

5246
### Usage Examples
5347

5448
#### Default Options
55-
In this example, the default options are used to do something with whatever. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result would be `Testing, 1 2 3.`
56-
57-
```js
58-
grunt.initConfig({
59-
jstransform: {
60-
options: {},
61-
files: {
62-
'dest/default_options': ['src/testing', 'src/123'],
63-
},
64-
},
65-
});
66-
```
67-
68-
#### Custom Options
69-
In this example, custom options are used to do something else with whatever else. So if the `testing` file has the content `Testing` and the `123` file had the content `1 2 3`, the generated result in this case would be `Testing: 1 2 3 !!!`
49+
In this example, the javascript written in ES6 will transpile classes, arrow funciton, and object short notation down to ES5 code.
7050

7151
```js
7252
grunt.initConfig({
7353
jstransform: {
7454
options: {
75-
separator: ': ',
76-
punctuation: ' !!!',
55+
visitors: ['class', 'arrow-function', 'object-short-notation']
7756
},
7857
files: {
79-
'dest/default_options': ['src/testing', 'src/123'],
58+
'dest/app.js': ['src/app.js']
8059
},
81-
},
60+
}
8261
});
8362
```
8463

64+
This plugin supports all visitors exposed by [jstransform](https://github.com/facebook/jstransform) which are:
65+
66+
- class (declaration, expressions, extends, method, super)
67+
- arrow functions
68+
- object short notation
69+
- rest params
70+
- templates
71+
8572
## Contributing
8673
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using [Grunt](http://gruntjs.com/).
8774

0 commit comments

Comments
 (0)