then-read-json

Read JSON file using promises

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
then-read-json
1.0.36 years ago7 years agoMinified + gzip package size for then-read-json in KB

Readme

Read JSON file using promises

!code climatecodeclimate-imgcodeclimate-url !standard code stylestandard-imgstandard-url !travis build statustravis-imgtravis-url !coverage statuscoveralls-imgcoveralls-url !dependency statusdavid-imgdavid-url

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)

Related

  • 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 charlikenew-message-imgnew-message-url !freenode #charlikefreenode-imgfreenode-url

!tunnckocore.tkauthor-www-imgauthor-www-url !keybase tunnckocorekeybase-imgkeybase-url !tunnckoCore npmauthor-npm-imgauthor-npm-url !tunnckoCore twitterauthor-twitter-imgauthor-twitter-url !tunnckoCore githubauthor-github-imgauthor-github-url