Skip to content

bloodyKnuckles/xhr-promise-bare

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

xhr-promise-bare

Copied (and abbreviated) from here: http://www.html5rocks.com/en/tutorials/es6/promises/#toc-promisifying-xmlhttprequest

Bare bones Promise-based XHR.

example

var xhrPromise = require('xhr-promise-bare')

xhrPromise('https://baconipsum.com/api/?type=all-meat&paras=2&start-with-lorem=1')
  .then(
    function(result) {
      document.querySelector('#app').innerHTML = JSON.parse(result)[0]
    }, function(err) {
      console.log(err)
    })

install

npm install --save xhr-promise-bare

license

MIT

About

Bare bones Promise-based XHR.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published