Skip to content

bunnybones1/load-json-xhr

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

load-json-xhr

stable

Loads a JSON file from a URI using xhr. The return object is the XMLHttpRequest.

var load = require('load-json-xhr');

load('my-file.json', function(err, data) {
    if (err)
        throw err;
    console.log(data.foo.bar);
})

Also accepts an options object which is passed along to the xhr module.

var load = require('load-json-xhr');

load({ uri: 'my-file.json', timeout: 5000 }, function(err, data) {
    if (err)
        throw err;
    console.log(data.foo.bar);
})

Usage

NPM

getJSON(opt[, callback])

Gets JSON data from a uri specified in opt. Or you can pass a string.

License

MIT, see LICENSE.md for details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published