@peck/request-lite
v1.1.1
Published
Zero-dependency utility for making http requests and returning ES6 promises
Downloads
9
Readme
request-lite
Zero-dependency utility for making http requests and returning ES6 promises
- Written in Typescript
- Zero dependencies
- Returns an ES6 Promise
Usage
Usage is loosly modeled after the excellent request package, but with fewer features in exchange for zero dependencies.
import request from '@peck/request-lite'
let options = {
url: 'http://google.com',
method: 'GET',
}
request(options).then((response) => {
console.log('success: ',response);
}).catch((error) => {
console.error('This should not have failed! ', error);
});