Spur.js
A lightweight HTTP Get Request Helper
Usage
Follow these steps to get started:
Install
Using NPM, install Spur.js, then add it to your package.json dependencies.
$ npm install spur.js --save
Import
Import Spur from node_modules
, using any namespace desired.
import spur from 'spur.js'
Call
Spur uses Promises under the hood. Meaning a GET request uses the standard Promise syntax:
spur('url')
.then(response => {
// the request is done, and the status === 200
// ...
})
.catch(status => {
// the request is done, but the status !== 200
// ...
})
Because then
returns a Promise, you can chain it.
Browser Support
Note: IE does not natively support Promises, but Edge does.
License
MIT. © 2017 Eli Smith