UNPKG

3.04 kBMarkdownView Raw
1# gulp-livescript [![Travis CI][travis-image]][travis-url] [![Quality][codeclimate-image]][codeclimate-url] [![Coverage][coveralls-image]][coveralls-url] [![Dependencies][gemnasium-image]][gemnasium-url]
2> Compile LiveScript to JavaScript for Gulp
3
4[![Version][npm-image]][npm-url]
5
6
7## Information
8
9<table>
10<tr>
11<td>Package</td><td>gulp-livescript</td>
12</tr>
13<tr>
14<td>Description</td>
15<td>Compile LiveScript to JavaScript for Gulp</td>
16</tr>
17<tr>
18<td>Node Version</td>
19<td>>= 0.10</td>
20</tr>
21<tr>
22<td>Gulp Version</td>
23<td>>= 3.5.0</td>
24</tr>
25</table>
26
27
28## Example
29
30### See how we compile [`src/index.ls`](https://github.com/tomchentw/gulp-livescript/blob/master/src/index.ls) to [`index.js`](https://github.com/tomchentw/gulp-livescript/blob/master/index.js) in [this project](https://github.com/tomchentw/gulp-livescript/blob/master/gulpfile.ls).
31
32![`gulpfile.ls`](https://f.cloud.github.com/assets/922234/2353915/093164d2-a5ae-11e3-8016-d1191004acb2.png)
33
34
35## Usage
36
37```javascript
38var gulpLiveScript = require('gulp-livescript');
39
40gulp.task('ls', function() {
41 return gulp.src('./src/*.ls')
42 .pipe(gulpLiveScript({bare: true})
43 .on('error', gutil.log))
44 .pipe(gulp.dest('./public/'));
45});
46```
47
48
49### Error Handling
50
51`gulp-livescript` will [emit an error](https://github.com/tomchentw/gulp-livescript/blob/master/test/main.ls#L45) for cases such as invalid LiveScript syntax.
52
53If you need to exit gulp with non-0 exit code, attatch a lister and throw the error:
54
55```livescript
56gulp.task 'build' ->
57 return gulp.src 'test/fixtures/illegal.ls'
58 .pipe gulp-livescript bare: true
59 .on 'error' -> throw it
60 .pipe gulp.dest '.'
61```
62
63
64### Options
65
66The options object supports the same options as the standard LiveScript compiler.
67
68
69## Contributing
70
71[![devDependency Status][david-dm-image]][david-dm-url]
72
731. Fork it
742. Create your feature branch (`git checkout -b my-new-feature`)
753. Commit your changes (`git commit -am 'Add some feature'`)
764. Push to the branch (`git push origin my-new-feature`)
775. Create new Pull Request
78
79
80## Credits
81
82* [`gulp-coffee` by @wearefractal](https://github.com/wearefractal/gulp-coffee)
83
84
85[npm-image]: https://img.shields.io/npm/v/gulp-livescript.svg
86[npm-url]: https://www.npmjs.org/package/gulp-livescript
87
88[travis-image]: https://travis-ci.org/tomchentw/gulp-livescript.svg?branch=master
89[travis-url]: https://travis-ci.org/tomchentw/gulp-livescript
90[codeclimate-image]: https://img.shields.io/codeclimate/github/tomchentw/gulp-livescript.svg
91[codeclimate-url]: https://codeclimate.com/github/tomchentw/gulp-livescript
92[coveralls-image]: https://img.shields.io/coveralls/tomchentw/gulp-livescript.svg
93[coveralls-url]: https://coveralls.io/r/tomchentw/gulp-livescript
94[gemnasium-image]: https://gemnasium.com/tomchentw/gulp-livescript.svg
95[gemnasium-url]: https://gemnasium.com/tomchentw/gulp-livescript
96[david-dm-image]: https://david-dm.org/tomchentw/gulp-livescript/dev-status.svg?theme=shields.io
97[david-dm-url]: https://david-dm.org/tomchentw/gulp-livescript#info=devDependencies