Browse Source

fs-extra: upgraded jsonfile, gives JSON reviver/replacer support

ci/travis-osximage
JP Richardson 9 years ago
parent
commit
bfa8e44351
  1. 1
      CHANGELOG.md
  2. 9
      README.md
  3. 2
      package.json

1
CHANGELOG.md

@ -4,6 +4,7 @@
this package had both `fs.readJsonFile` and `fs.readJson` that were aliases to each other, now use `fs.readJson`.
- preliminary walker created. Intentionally not documented. If you use it, it will almost certainly change and break your code.
- started moving tests inline
- upgraded to `jsonfile@2.1.0`, can now pass JSON revivers/replacers to `readJson()`, `writeJson()`, `outputJson()`
0.19.0 / 2015-06-08
-------------------

9
README.md

@ -264,9 +264,10 @@ fs.outputFile(file, 'hello!', function (err) {
### outputJson(file, data, callback)
### outputJson(file, data, [options], callback)
Almost the same as `writeJson`, except that if the directory does not exist, it's created.
`options` are what you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback).
Alias: `outputJSON()`
@ -292,7 +293,8 @@ fs.outputJson(file, {name: 'JP'}, function (err) {
### readJson(file, [options], callback)
Reads a JSON file and then parses it into an object. `options` are the same that you'd pass to `fs.readFile`.
Reads a JSON file and then parses it into an object. `options` are the same
that you'd pass to [`jsonFile.readFile`](https://github.com/jprichardson/node-jsonfile#readfilefilename-options-callback).
Alias: `readJSON()`
@ -349,7 +351,8 @@ fs.removeSync('/home/jprichardson') //I just deleted my entire HOME directory.
### writeJson(file, object, [options], callback)
Writes an object to a JSON file. `options` are the same that you'd pass to `fs.readFile`.
Writes an object to a JSON file. `options` are the same that
you'd pass to [`jsonFile.writeFile()`](https://github.com/jprichardson/node-jsonfile#writefilefilename-options-callback).
Alias: `writeJSON()`

2
package.json

@ -34,7 +34,7 @@
"license": "MIT",
"dependencies": {
"graceful-fs": "^3.0.5",
"jsonfile": "^2.0.0",
"jsonfile": "^2.1.0",
"rimraf": "^2.2.8"
},
"devDependencies": {

Loading…
Cancel
Save