🚨 Latest Research:Tanstack npm Packages Compromised in Ongoing Mini Shai-Hulud Supply-Chain Attack.Learn More →
Socket
Book a DemoSign in
Socket

nano-fetch

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nano-fetch

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

latest
Source
npmnpm
Version
0.2.1
Version published
Maintainers
1
Created
Source

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

Keywords

ajax

FAQs

Package last updated on 22 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts