Skip to content

Commit

Permalink
Use 'Buffer.from'. Yarn.
Browse files Browse the repository at this point in the history
  • Loading branch information
gluons committed Nov 21, 2016
1 parent 8e72bcc commit a29366a
Show file tree
Hide file tree
Showing 8 changed files with 774 additions and 13 deletions.
13 changes: 13 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
root = true

[*]
indent_style = tab
indent_size = 4
charset = utf-8

[*.md]
trim_trailing_whitespace = false

[{*.{coffee,cson,yml,yaml,jade,pug},{package,bower}.json}]
indent_style = space
indent_size = 2
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: node_js
node_js:
- "5"
- "4"
- "6"

This comment has been minimized.

Copy link
@gluons

gluons Nov 22, 2016

Author Owner

Add Node.js 6 for testing.

- "5"
- "4"
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
[![GitHub license](https://img.shields.io/github/license/gluons/gulp-json2cson.svg?style=flat-square)]()
[![npm](https://img.shields.io/npm/v/gulp-json2cson.svg?style=flat-square)](https://www.npmjs.com/package/gulp-json2cson)
[![npm](https://img.shields.io/npm/dt/gulp-json2cson.svg?style=flat-square)](https://www.npmjs.com/package/gulp-json2cson)
[![Travis branch](https://img.shields.io/travis/gluons/gulp-json2cson/master.svg?style=flat-square)](https://travis-ci.org/gluons/gulp-json2cson)
[![Travis branch](https://img.shields.io/travis/gluons/gulp-json2cson/node-6-buffer.svg?style=flat-square)](https://travis-ci.org/gluons/gulp-json2cson)

[Gulp](http://gulpjs.com/) plugin to parse JSON to CSON with [bevry/cson](https://github.com/bevry/cson)

Expand Down
9 changes: 9 additions & 0 deletions coffeelint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"indentation": {
"uses": "spaces",
"value": 2
},
"max_line_length": {
"level": "ignore"
}
}
2 changes: 1 addition & 1 deletion index.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = (indent = ' ') ->

try
json = JSON.parse file.contents.toString()
file.contents = new Buffer CSON.stringify json, null, indent
file.contents = Buffer.from CSON.stringify json, null, indent

This comment has been minimized.

Copy link
@gluons

gluons Nov 22, 2016

Author Owner

new Buffer() constructor now deprecated. Use Buffer.from() instead.

nodejs/node#4682

file.path = gutil.replaceExtension file.path, '.cson'

callback null, file
Expand Down
11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,12 @@
},
"homepage": "https://github.com/gluons/gulp-json2cson#readme",
"dependencies": {
"coffee-script": "^1.10.0",
"cson": "^3.0.2",
"coffee-script": "^1.11.1",
"cson": "^4.0.0",
"gulp-util": "^3.0.7",
"through2": "^2.0.1"
},
"devDependencies": {
"mocha": "^2.4.5"
},
"coffeelintConfig": {
"max_line_length": {
"level": "ignore"
}
"mocha": "*"
}
}
1 change: 0 additions & 1 deletion test/test.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ describe 'JSON to CSON', () ->
myParser.once 'error', (err) ->
assert.notEqual err, null
assert.equal err.name, 'SyntaxError'
assert.equal err.message, 'Unexpected token :'
done()
return

Expand Down
Loading

0 comments on commit a29366a

Please sign in to comment.