Package Exports
- @toruslabs/http-helpers
- @toruslabs/http-helpers/dist/lib.cjs/index.js
- @toruslabs/http-helpers/dist/lib.esm/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@toruslabs/http-helpers) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Http helpers
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
lib.esm
builddist/lib.esm/index.js
in es6 formatlib.cjs
builddist/lib.cjs/index.js
in es5 formatumd
builddist/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
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 20+