nf

nano-fetch

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

Showing:

Popularity

Downloads/wk

3

GitHub Stars

0

Maintenance

Last Commit

2yrs ago

Contributors

2

Package

Dependencies

0

License

MIT

Type Definitions

Tree-Shakeable

Yes?

Categories

Readme

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

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100
No reviews found
Be the first to rate

Alternatives

No alternatives found

Tutorials

No tutorials found
Add a tutorial