then-stringify-json

Gracefully stringify JSON using promises - promisified JSON.stringify

Usage no npm install needed!

<script type="module">
  import thenStringifyJson from 'https://cdn.skypack.dev/then-stringify-json';
</script>

README

then-stringify-json npmjs.com The MIT License

Gracefully stringify JSON using promises - promisified JSON.stringify

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

Install

npm i then-stringify-json --save
npm test

Usage

For more use-cases see the tests

var JSONStringify = require('then-stringify-json')

JSONStringify({foo: 'bar'})
.then(function (res) {
  console.log(res)
  //=> '{"foo":"bar"}'
})
.catch(console.error)

Related

  • bluebird: Full featured Promises/A+ implementation with exceptionally good performance
  • make-callback: Make synchronous function to support callback api
  • promise: Bare bones Promises/A+ implementation
  • try-read-json: Fast, meaningful and correct try/catch flow for reading JSON with JSON.parse - support optional callback
  • then-parse-json: Gracefully parse JSON using promises - promisified JSON.parse
  • then-read-json: Read JSON file using promises

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