Skip to content

JannesMeyer/xhr-tool

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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);
});

Releases

No releases published

Packages

No packages published