npm.io
1.1.1 • Published 7 years ago

@peck/request-lite

Licence
ISC
Version
1.1.1
Deps
0
Size
9 kB
Vulns
0
Weekly
0

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