autofetch

fetch for node

Stats

StarsIssuesVersionUpdatedCreatedSize
autofetch
074.1.04 years ago5 years agoMinified + gzip package size for autofetch in KB

Readme

autoFetch

npm

fetch api with customer auto pre actions

Installation

$ npm install autoFetch

Why Not isomorphic-fetch

  • More api for node env
    • Headers.keys
    • Headers.values
  • global baseHost,callback,headers,queries and url params

Usage

require('autoFetch');

fetch.baseHost('http://domain.com');

fetch('//path'); // http://domain.com/path;

fetch.baseHost((url)=>{
  return url += '/path';
})

fetch('//path'); // http://domain.com/path;

fetch('//user/:id',{ params: { id: 123 } }); // http://domain.com/user/123

fetch.callback((response)=>{
  console.log(response);
  return response;
});

Contribution

PR and issue welcome

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.