promisify-fetch

1.0.5 • Public • Published

promisify-fetch

The library is a wrapper for 'fetch' in promising way. It it commonly used for downloading files or get http content from the remote.

Usage

var fetch = require('promisify-fetch');
 
fetch
  .fetchURL('http://google.com')
  .then(function(body) {
    console.log(body);
  })
  .catch(function(e) {
    console.log(e);
  })

API

This is a primising wrapper for 'fetch' package. more specific options, please refer to fetch

/**
 * fetch url content from remote
 * @param  {string} url      url
 * @param  {object} options  Please refer to https://www.npmjs.com/package/fetch
 * @return {promise}         promise
 */
 
fetchURL(url[,options])

Inspired by fetch

Good Library Companions

Package Sidebar

Install

npm i promisify-fetch

Weekly Downloads

0

Version

1.0.5

License

MIT

Last publish

Collaborators

  • xinwangwang