3.1.4 • Published 11 months ago

@js-bits/fetch v3.1.4

Weekly downloads
-
License
ISC
Repository
github
Last release
11 months ago

Cross-environment (nodejs/web) fetch APi

This package exports window.fetch object in a browser and node-fetch module in a Node.js environment. Which is helpful when you develop a package compatible with both environments and use fetch for HTTP requests. Allows to avoid conditional imports.

Installation

Install with npm:

npm install @js-bits/fetch

Install with yarn:

yarn add @js-bits/fetch

Import where you need it:

import fetch from '@js-bits/fetch';

or require for CommonJS:

const fetch = require('@js-bits/fetch');

How to use

fetch('http://example.com/movies.json')
  .then(response => response.json())
  .then(data => console.log(data));

Notes

3.1.3

12 months ago

3.1.2

12 months ago

3.1.1

12 months ago

3.1.0

12 months ago

3.1.4

11 months ago

3.0.2

2 years ago

3.0.1

2 years ago

3.0.0

2 years ago

2.0.0

2 years ago

1.0.0

3 years ago

0.2.0

3 years ago

0.1.2

3 years ago

0.1.3

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago

0.0.1

3 years ago