xhr-tool

1.0.8 • Public • Published

xhr-tool

Build Status Dependencies Development Dependencies

Install the package like this:

npm install xhr-tool

Import the function

var getJSON = require('xhr-tool').getJSON;

Needs a browser that supports Promises or a Promise polyfill.

getJSON

getJSON(url) → Promise → Object

Sends an asynchronous request and returns a Promise for the parsed JSON response

Example usage:

getJSON('http://www.nactem.ac.uk/software/acromine/dictionary.py?sf=BMI').then(function(obj) {
	console.log(obj);
});

Readme

Keywords

Package Sidebar

Install

npm i xhr-tool

Weekly Downloads

1

Version

1.0.8

License

LGPLv3

Last publish

Collaborators

  • jannes