@toruslabs/http-helpers
TypeScript icon, indicating that this package has built-in type declarations

7.0.0 • Public • Published

Http helpers

npm version npm

Introduction

  • This package allows you to call http methods with pre defined configs. Uses fetch or node-fetch internally
  • Adds support for api keys
  • Works in both browser and node.js environments

Installation

Bundling

This module is distributed in 3 formats

  • esm build dist/httpHelpers.esm.js in es6 format
  • commonjs build dist/httpHelpers.cjs.js in es5 format
  • umd build dist/httpHelpers.umd.min.js in es5 format without polyfilling corejs minified

By default, the appropriate format is used for your specified usecase You can use a different format (if you know what you're doing eg. node) by referencing the correct file

The cjs build is not polyfilled with core-js. It is upto the user to polyfill based on the browserlist they target

Directly in Browser

CDN's serve the non-core-js polyfilled version by default. You can use a different

jsdeliver

<script src="https://cdn.jsdelivr.net/npm/@toruslabs/http-helpers"></script>

unpkg

<script src="https://unpkg.com/@toruslabs/http-helpers"></script>

Usage

Add @toruslabs/http-helpers to your project:

import { get, post } from "@toruslabs/http-helpers";
const { get, post } = require("@toruslabs/http-helpers").default;

Requirements

  • This package requires a peer dependency of @babel/runtime
  • Node 18+

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
7.0.08,083latest

Version History

VersionDownloads (Last 7 Days)Published
7.0.08,083
6.1.114,536
6.1.0338
6.0.01,420
5.0.07,830
4.0.03,697
3.4.033,810
3.3.01,659
3.2.01,174
3.1.0199
3.0.098
2.2.01,197
2.1.4180
2.1.30
2.1.20
2.1.1248
2.1.01
2.0.00
1.4.0505
1.3.760
1.3.60
1.3.510
1.3.432
1.3.32
1.3.20
1.3.10
1.3.00
1.2.11
1.2.00
1.1.20
1.1.10
1.1.00
1.0.20
1.0.10
1.0.00

Package Sidebar

Install

npm i @toruslabs/http-helpers

Weekly Downloads

75,080

Version

7.0.0

License

MIT

Unpacked Size

63.1 kB

Total Files

9

Last publish

Collaborators

  • archit_web3
  • himanshunpm009
  • torusresearch
  • chaitanyapotti
  • tetratorus