- 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
This module is distributed in 3 formats
-
esm
builddist/httpHelpers.esm.js
in es6 format -
commonjs
builddist/httpHelpers.cjs.js
in es5 format -
umd
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
The cjs build is not polyfilled with core-js. It is upto the user to polyfill based on the browserlist they target
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>
Add @toruslabs/http-helpers
to your project:
import { get, post } from "@toruslabs/http-helpers";
const { get, post } = require("@toruslabs/http-helpers").default;
- This package requires a peer dependency of
@babel/runtime
- Node 18+