xchainjs-lib
xchainjs-lib copied to clipboard
replace axios with the Fetch API
- unpacked size of
axios1.9.0: 2.16 MB - unpacked size of
node-fetch2.7.0: 162 kB - native support for
fetchin Node.js: priceless
Impact on tests
axios-mock-adapter in the Jest unit tests would need replacing by msw.
ky
If instead of fetch the project starts using ky, a light wrapper around fetch that provides fetch's API with added TypeScript generics, hooks.beforeRequest could replace any use of axios.interceptors, or even be used to mock up a custom Response in the unit tests.