Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

then-read-json

tunnckocore3.4kMIT1.0.3

Read JSON file using promises

aplus, bluebird, file, json, json-file, native, parse, promise, promises, read, read-file, read-json, readfile, then

readme

then-read-json npmjs.com The MIT License

Read JSON file using promises

code climate standard code style travis build status coverage status dependency status

Install

npm i then-read-json --save
npm test

Usage

For more use-cases see the tests

var thenReadJson = require('then-read-json')

thenReadJson('./package.json')
.then(function (res) {
  console.log(res)
  //=> {name: 'then-read-json' ...}
})
.catch(console.error)
  • make-callback: Make synchronous function to support callback api
  • then-parse-json: Gracefully parse JSON using promises - promisified JSON.parse
  • then-stringify-json: Gracefully stringify JSON using promises - promisified JSON.stringify
  • then-write-json: Write contents to JSON file using JSON.stringify and promises… more
  • then-write-file: Write file to disk, using promises and creating recursively… more
  • try-read-json: Fast, meaningful and correct try/catch flow for reading JSON with JSON.parse - support optional callback

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.
But before doing anything, please read the CONTRIBUTING.md guidelines.

Charlike Make Reagent new message to charlike freenode #charlike

tunnckocore.tk keybase tunnckocore tunnckoCore npm tunnckoCore twitter tunnckoCore github

changelog

1.0.3 - 2016-07-17

  • Release v1.0.3 / npm@v1.0.3
  • update travis builds
  • Merge pull request #3 from kesla/master
  • update dependencies, @kesla
  • remove then-parse-json from package.json
  • remove then-parse-json

1.0.1 - 2015-05-31

  • Release v1.0.1 / npm@v1.0.1
  • update related
  • use mz/fs instead

1.0.0 - 2015-05-30

  • Release v1.0.0 / npm@v1.0.0
  • add keywords
  • implement

0.0.0 - 2015-05-30

  • first commits