Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

pull-fetch-iso

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pull-fetch-iso

Opinionated one-function http client for Node.js and browser bundles

  • 0.0.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Pull fetch isomorphic

var fetch = require('pull-fetch-iso');
var toPromise = require('pull-to-promise');

pull(
	fetch({
		url: 'http://localhost/books.ndjson',

		retries: [
			{ delay: 100 },
			{ delay: 2000 },
			{ delay: 10000 },
		],
	}),

	pull.log()
);

toPromise(fetch({
	url: 'http://localhost/books/the-little-mermaid.json',

	retries: [
		{ delay: 100 },
		{ delay: 2000 },
		{ delay: 10000 },
	],
}))
	.then(console.log);
fetch({
	retries

	// complete URL, `query` appended, overwrites `host` and `path`
	url

	// will be concatenated
	host
	path

	/*
	A string will simply be appended to the URL while an object will be
	stringified by `http-querystring-stringify`
	*/
	query

	method

	headers: {
		name: value
	}

	/*
	A JSON serializable value, a DOM File or DOM FormData. Any value. Will be
	stringified if the "Content-Type" header is not overwritten and it is not
	a DOM File or FormData.
	*/
	data
});

FAQs

Package last updated on 19 Feb 2017

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc