# warp-isomorphic

> Isomorphic API for Node & browser

Latest version **1.0.7** (published 2023-08-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install warp-isomorphic
pnpm add warp-isomorphic
yarn add warp-isomorphic
bun add warp-isomorphic
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2023-08-09 |
| First published | 2023-01-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=16.8.0 |
| Dependencies | 2 |
| Unpacked size | 25.8 KB |
| Known vulnerabilities | 0 (+12 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Warp Team |
| Maintainers | redstone-finance |

## Links

- npm: https://www.npmjs.com/package/warp-isomorphic
- Repository: https://github.com/warp-contracts/warp-isomorphic
- Homepage: https://github.com/warp-contracts/warp-isomorphic#readme
- Issues: https://github.com/warp-contracts/warp-isomorphic/issues
- npm.io page: https://npm.io/package/warp-isomorphic

## Dependencies (2)

- [buffer](https://npm.io/package/buffer.md) ^6.0.3
- [undici](https://npm.io/package/undici.md) ^5.19.1

## Recent versions

- 1.0.7 (latest) — 2023-08-09
- 1.0.6 — 2023-08-09
- 1.0.5 — 2023-08-09
- 1.0.4 — 2023-02-24
- 1.0.3 — 2023-02-24
- 1.0.2 — 2023-02-23
- 1.0.1 — 2023-02-23
- 1.0.0 — 2023-01-27

## README

# warp-isomorphic

warp-isomorphic is a fork of [isomorphic-fetch](https://github.com/matthew-andrews/isomorphic-fetch).

# fetch

It adds `fetch` as global so its API is consistent between client and server. It uses standard fetch() method on client's side and [undici](https://github.com/nodejs/undici) - which is an http client written for Node.js - on server's side.

# Buffer

It provides Buffer object with API consistent between server and client.

## Installation

### NPM

```sh
npm install --save warp-isomorphic
```

### YARN

```sh
yarn add warp-isomorphic
```

## Usage

#### fetch

```js
import "warp-isomorphic";

fetch("//api.redstone.finance")
  .then(function (response) {
    if (response.status >= 400) {
      throw new Error("Bad response from server");
    }
    return response.json();
  })
  .then(function (data) {
    console.log(data);
  });
```

#### Buffer

```js
import { Buffer } from "warp-isomorphic";

const arr = new Uint16Array(2);

arr[0] = 5000;
arr[1] = 4000;

const buf = Buffer.from(arr.buffer);
```

---
_Source: https://npm.io/package/warp-isomorphic · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
