Skip to content

Commit 4177fd9

Browse files
committed
📝 Update readme
1 parent 4e2705e commit 4177fd9

File tree

1 file changed

+25
-11
lines changed

1 file changed

+25
-11
lines changed

README.md

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,56 @@
44
[![npm](https://img.shields.io/npm/dt/gulp-json2cson.svg?style=flat-square)](https://www.npmjs.com/package/gulp-json2cson)
55
[![Travis](https://img.shields.io/travis/gluons/gulp-json2cson.svg?style=flat-square)](https://travis-ci.org/gluons/gulp-json2cson)
66

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).
88

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).
1010

1111
## Installation
12+
1213
[![NPM](https://nodei.co/npm/gulp-json2cson.png?downloads=true&downloadRank=true&stars=true)](https://www.npmjs.com/package/gulp-json2cson)
14+
15+
**Via [npm](https://www.npmjs.com/):**
16+
1317
```
1418
npm install --save-dev gulp-json2cson
1519
```
1620

21+
**Via [Yarn](https://yarnpkg.com/):**
22+
23+
```
24+
yarn add --dev gulp-json2cson
25+
```
26+
1727
## Usage
28+
1829
```javascript
19-
var gulp = require('gulp');
20-
var json2cson = require('gulp-json2cson');
30+
const gulp = require('gulp');
31+
const json2cson = require('gulp-json2cson');
2132

22-
gulp.task('json2cson', function () {
33+
gulp.task('json2cson', () => {
2334
return gulp.src('src/data.json')
2435
.pipe(json2cson())
2536
.pipe(gulp.dest('dest'));
2637
});
27-
28-
gulp.task('default', ['json2cson']);
2938
```
39+
3040
## API
41+
3142
### json2cson(indent)
32-
Parse JSON to CSON with indentation.
43+
44+
Parse JSON to CSON with desired indentation.
45+
3346
```javascript
34-
var gulp = require('gulp');
35-
var json2cson = require('gulp-json2cson');
47+
const gulp = require('gulp');
48+
const json2cson = require('gulp-json2cson');
3649

37-
gulp.task('json2cson', function () {
50+
gulp.task('json2cson', () => {
3851
return gulp.src('src/data.json')
3952
.pipe(json2cson('\t'))
4053
.pipe(gulp.dest('dest'));
4154
});
4255
```
56+
4357
#### indent
4458
Type: `String`
4559
Default: ` ` (2 spaces)

0 commit comments

Comments
 (0)