This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

nano-fetch

0.2.1 • Public • Published

nano-fetch

A tiny window.fetch-like promise-based AJAX implementation

It's based on XMLHttpRequest so refer to its documentation for the expected output. It defaults to JSON output and GET requests.

gzipped size

Usage

nanoFetch('page.php').then(function (jsonResponse) {
    //...
}).catch(function (error) {
    //...
});
nanoFetch('page.php', {
    responseType: 'document',
    method: 'POST'
}).then(function (documentElement) {
    //...
}).catch(function (error) {
    //...
});

With browserify

npm install --save nano-fetch
var nanoFetch = require('nano-fetch');

API

nanoFetch(url[, options])

  • url is an absolute or relative URL
  • options is an object with the properties:

Dependencies

None

License

MIT © Federico Brigante

Package Sidebar

Install

npm i nano-fetch

Weekly Downloads

0

Version

0.2.1

License

MIT

Last publish

Collaborators

  • fregante