|
4 | 4 | [](https://www.npmjs.com/package/gulp-json2cson)
|
5 | 5 | [](https://travis-ci.org/gluons/gulp-json2cson)
|
6 | 6 |
|
7 |
| -[Gulp](http://gulpjs.com/) plugin to parse JSON to CSON with [bevry/cson](https://github.com/bevry/cson) |
| 7 | +[Gulp](http://gulpjs.com/) plugin to parse JSON to CSON with [bevry/cson](https://github.com/bevry/cson). |
8 | 8 |
|
9 |
| -If you want to parse CSON to JSON, use [gulp-cson](https://github.com/stevelacy/gulp-cson) |
| 9 | +If you want to parse CSON to JSON, use [gulp-cson](https://github.com/stevelacy/gulp-cson). |
10 | 10 |
|
11 | 11 | ## Installation
|
| 12 | + |
12 | 13 | [](https://www.npmjs.com/package/gulp-json2cson)
|
| 14 | + |
| 15 | +**Via [npm](https://www.npmjs.com/):** |
| 16 | + |
13 | 17 | ```
|
14 | 18 | npm install --save-dev gulp-json2cson
|
15 | 19 | ```
|
16 | 20 |
|
| 21 | +**Via [Yarn](https://yarnpkg.com/):** |
| 22 | + |
| 23 | +``` |
| 24 | +yarn add --dev gulp-json2cson |
| 25 | +``` |
| 26 | + |
17 | 27 | ## Usage
|
| 28 | + |
18 | 29 | ```javascript
|
19 |
| -var gulp = require('gulp'); |
20 |
| -var json2cson = require('gulp-json2cson'); |
| 30 | +const gulp = require('gulp'); |
| 31 | +const json2cson = require('gulp-json2cson'); |
21 | 32 |
|
22 |
| -gulp.task('json2cson', function () { |
| 33 | +gulp.task('json2cson', () => { |
23 | 34 | return gulp.src('src/data.json')
|
24 | 35 | .pipe(json2cson())
|
25 | 36 | .pipe(gulp.dest('dest'));
|
26 | 37 | });
|
27 |
| - |
28 |
| -gulp.task('default', ['json2cson']); |
29 | 38 | ```
|
| 39 | + |
30 | 40 | ## API
|
| 41 | + |
31 | 42 | ### json2cson(indent)
|
32 |
| -Parse JSON to CSON with indentation. |
| 43 | + |
| 44 | +Parse JSON to CSON with desired indentation. |
| 45 | + |
33 | 46 | ```javascript
|
34 |
| -var gulp = require('gulp'); |
35 |
| -var json2cson = require('gulp-json2cson'); |
| 47 | +const gulp = require('gulp'); |
| 48 | +const json2cson = require('gulp-json2cson'); |
36 | 49 |
|
37 |
| -gulp.task('json2cson', function () { |
| 50 | +gulp.task('json2cson', () => { |
38 | 51 | return gulp.src('src/data.json')
|
39 | 52 | .pipe(json2cson('\t'))
|
40 | 53 | .pipe(gulp.dest('dest'));
|
41 | 54 | });
|
42 | 55 | ```
|
| 56 | + |
43 | 57 | #### indent
|
44 | 58 | Type: `String`
|
45 | 59 | Default: ` ` (2 spaces)
|
|
0 commit comments