Socket
Socket
Sign inDemoInstall

warp-isomorphic

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

warp-isomorphic

Isomorphic API for Node & browser


Version published
Maintainers
1
Created
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

Package last updated on 09 Aug 2023

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