Socket
Socket
Sign inDemoInstall

warp-isomorphic

Package Overview
Dependencies
5
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    warp-isomorphic

Isomorphic API for Node & browser


Version published
Weekly downloads
11K
decreased by-11.42%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

warp-isomorphic

warp-isomorphic is a fork of 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 - 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

npm install --save warp-isomorphic

YARN

yarn add warp-isomorphic

Usage

fetch
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
import { Buffer } from "warp-isomorphic";

const arr = new Uint16Array(2);

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

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

FAQs

Last updated on 09 Aug 2023

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc