Comparing version 2.0.1 to 2.1.0
@@ -0,1 +1,6 @@ | ||
2.1.0 / 2015-06-19 | ||
------------------ | ||
- cleanup: JavaScript Standard Style, rename files, dropped terst for assert | ||
- methods now support JSON revivers/replacers | ||
2.0.1 / 2015-05-24 | ||
@@ -2,0 +7,0 @@ ------------------ |
{ | ||
"name": "jsonfile", | ||
"version": "2.0.1", | ||
"version": "2.1.0", | ||
"description": "Easily read/write JSON files.", | ||
@@ -13,3 +13,5 @@ "repository": { | ||
"file", | ||
"json" | ||
"json", | ||
"fs", | ||
"fs-extra" | ||
], | ||
@@ -20,10 +22,10 @@ "author": "JP Richardson <jprichardson@gmail.com>", | ||
"devDependencies": { | ||
"testutil": "^0.7.0", | ||
"mocha": "*", | ||
"terst": "^0.2.0" | ||
"mocha": "2.x", | ||
"rimraf": "^2.4.0", | ||
"standard": "4.x" | ||
}, | ||
"main": "./lib/jsonfile.js", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "mocha test" | ||
"test": "standard && mocha test" | ||
} | ||
} |
@@ -1,9 +0,9 @@ | ||
[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.png)](http://travis-ci.org/jprichardson/node-jsonfile) | ||
Node.js - jsonfile | ||
================ | ||
Easily read/write JSON files. | ||
Easily read/write JSON files. | ||
[![build status](https://secure.travis-ci.org/jprichardson/node-jsonfile.png)](http://travis-ci.org/jprichardson/node-jsonfile) | ||
Why? | ||
@@ -28,3 +28,6 @@ ---- | ||
```javascript | ||
`options`: Pass in any `fs.readFile` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). | ||
```js | ||
var jf = require('jsonfile') | ||
@@ -35,3 +38,3 @@ var util = require('util') | ||
jf.readFile(file, function(err, obj) { | ||
console.log(util.inspect(obj)) | ||
console.dir(obj) | ||
}) | ||
@@ -43,3 +46,6 @@ ``` | ||
```javascript | ||
`options`: Pass in any `fs.readFileSync` options or set `reviver` for a [JSON reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse). Also `throws` set to `false` if you don't ever want this method | ||
to throw on invalid JSON. Will return `null` instead. Defaults to `true`. | ||
```js | ||
var jf = require('jsonfile') | ||
@@ -50,11 +56,12 @@ var util = require('util') | ||
console.log(util.inspect(jf.readFileSync(file))) | ||
console.dir(jf.readFileSync(file)) | ||
``` | ||
**options**: `throws`. Set to `false` if you don't ever want this method to throw on invalid JSON. Will return `null` instead. Defaults to `true`. Others passed directly to `fs.readFileSync`. | ||
### writeFile(filename, [options], callback) | ||
```javascript | ||
`options`: Pass in any `fs.writeFile` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). | ||
```js | ||
var jf = require('jsonfile') | ||
@@ -70,5 +77,8 @@ | ||
### writeFileSync(filename, [options]) | ||
```javascript | ||
`options`: Pass in any `fs.writeFileSync` options or set `replacer` for a [JSON replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify). | ||
```js | ||
var jf = require('jsonfile') | ||
@@ -85,7 +95,7 @@ | ||
Number of spaces to indent JSON files. | ||
Number of spaces to indent JSON files. | ||
**default:** 2 | ||
**default:** `null` | ||
``` | ||
```js | ||
var jf = require('jsonfile') | ||
@@ -127,3 +137,3 @@ | ||
Copyright 2012-2014, JP Richardson <jprichardson@gmail.com> | ||
Copyright 2012-2015, JP Richardson <jprichardson@gmail.com> | ||
@@ -130,0 +140,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
14180
7
253
137
2