promise-json
v1.0.2
Published
HTTP GET a json document returning a Promise
Downloads
8
Maintainers
Readme
promise-json
HTTP GET a json document returning a Promise
WARNING: this is not production quality software, use at your own risk
usage
const json = require('promise-json')
json('https://en.wikipedia.org/w/api.php?action=query&titles=Tardigrade&format=json')
.then(console.log)
api
with jsig type annotation:
json(url: String) => Promise<Object>
Follows redirects. Resolves to JavaScript Object. Rejects on HTTP status >= 400 or JSON parse error.
installation
$ npm install promise-json
running the tests
From package root:
$ npm install
$ npm test
contributors
- jden [email protected]
license
ISC. (c) MMXVI jden [email protected]. See LICENSE.md