Skip to content

Commit

Permalink
update package name and docs (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
svix-frank authored Jan 19, 2022
1 parent c7a72f7 commit ec05dee
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
1 change: 1 addition & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
The MIT License (MIT)

Copyright (c) 2015 Matt Andrews
Copyright (c) 2022 Svix, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 14 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,39 +1,34 @@
isomorphic-fetch [![Build Status](https://travis-ci.org/matthew-andrews/isomorphic-fetch.svg?branch=master)](https://travis-ci.org/matthew-andrews/isomorphic-fetch)
================
<h1 align="center">
<a href="https://www.svix.com">
<img width="120" src="https://avatars.githubusercontent.com/u/80175132?s=200&v=4" />
<p align="center">Svix - Webhooks as a service</p>
</a>
</h1>

Fetch for node and Browserify. Built on top of [GitHub's WHATWG Fetch polyfill](https://github.com/github/fetch).
svix-fetch is a fork of Matthew Andrew's wonderful WHATWG Fetch polyfill for node and bowserfy: [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).

## Warnings
The main purpose of this fork is to enable keepalives when running in a node context.

- This adds `fetch` as a global so that its API is consistent between client and server.

For [ease-of-maintenance and backward-compatibility reasons][why polyfill], this library will always be a polyfill. As a "safe" alternative, which does not modify the global, consider [fetch-ponyfill][].

[why polyfill]: https://github.com/matthew-andrews/isomorphic-fetch/issues/31#issuecomment-149668361
[fetch-ponyfill]: https://github.com/qubyte/fetch-ponyfill

## Why Use Isomorphic Fetch

The Fetch API is currently [not implemented consistently](http://caniuse.com/#search=fetch) across browsers. This module will enable you to use `fetch` in your Node code in a cross-browser compliant fashion. The Fetch API is part of the Web platform API defined by the standards bodies WHATWG and W3C.
Unless you have a specific need for this functionality we recommend using [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).

## Installation

### NPM

```sh
npm install --save isomorphic-fetch
npm install --save svix-fetch
```

### Bower

```sh
bower install --save isomorphic-fetch
bower install --save svix-fetch
```

## Usage

```js
require('isomorphic-fetch');
require('svix-fetch');

fetch('//offline-news-api.herokuapp.com/stories')
.then(function(response) {
Expand All @@ -49,9 +44,10 @@ fetch('//offline-news-api.herokuapp.com/stories')

## License

All open source code released by FT Labs is licenced under the MIT licence. Based on [the fine work by](https://github.com/github/fetch/pull/31) **[jxck](https://github.com/Jxck)**.
This code is licenced under the MIT licence. Based on [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch) by **[matthew-andrews](https://github.com/matthew-andrews)**.

## Alternatives

- [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).
- [cross-fetch](https://github.com/lquixada/cross-fetch#why-not-isomorphic-fetch)
- Using [node-fetch](https://github.com/node-fetch/node-fetch) and the [Fetch polyfill](https://github.com/github/fetch) directly (or from [polyfill.io](https://polyfill.io), or relying on [the browser's implementation of the Fetch API](https://caniuse.com/fetch)).
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "isomorphic-fetch",
"name": "svix-fetch",
"main": ["fetch-bower.js"],
"dependencies": {
"fetch": "github/fetch#^3.4.1"
Expand Down
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "isomorphic-fetch",
"name": "svix-fetch",
"version": "3.0.0",
"description": "Isomorphic WHATWG Fetch API, for Node & Browserify",
"description": "An isomorphic WHATWG Fetch API, for Node & Browserify with keepalives",
"browser": "fetch-npm-browserify.js",
"main": "fetch-npm-node.js",
"scripts": {
Expand All @@ -10,14 +10,17 @@
},
"repository": {
"type": "git",
"url": "https://github.com/matthew-andrews/isomorphic-fetch.git"
"url": "https://github.com/svix/svix-fetch.git"
},
"author": "Matt Andrews <[email protected]>",
"contributors": [
"Svix Inc. <[email protected]>"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/matthew-andrews/isomorphic-fetch/issues"
"url": "https://github.com/svix/svix-fetch/issues"
},
"homepage": "https://github.com/matthew-andrews/isomorphic-fetch/issues",
"homepage": "https://github.com/svix/svix-fetch/issues",
"dependencies": {
"node-fetch": "^2.6.1",
"whatwg-fetch": "^3.4.1"
Expand Down

0 comments on commit ec05dee

Please sign in to comment.