1.0.7 • Published 7 years ago

get-json-promise v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Get json promise

Tiny module for getting JSON from a URL as a promise. Will only work where the XMLHttpRequest exists, which is not native in e.g. nodejs. It also does not include any promise library - so it may not work in older browsers.

Install

npm require --save get-json-promise

Usage

var jsonPromise = require('get-json-promise');

var url = 'http://localhost:8080/package.json';

jsonPromise(url).then(function(data) {
    console.log(data);
    // Returns object JSON.parse 
});

Example in a HTML page:

See index.html

MIT © Dennis Iversen

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago