v9.0.0
v9 is now pure ESM 馃帀
cacheable-request
is now pure ESM with version v9.0.0
and up. Version v.8.x.x
is the supported commonjs version which will get only major security fixes moving forward until end of 2022. If you would like to learn about uprgrading / using ESM @sindresorhus has an amazing reference guide here: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c
Major thank you to @alphmth, @sindresorhus, @szmarczak, @jasonbaik, and everybody for help on this. 馃檶
Special call out to @CyberShadow as in the previous release we forgot to mention the work done on issue #28 as without their guidance and code we wouldn't have fixed it. 鉂わ笍
Typescript
In addition to pure ESM we are now fulling using Typescript moving forward on this project which means all type definitions are now native with the service. 馃ぉ
Hooks!
Hooks have been introduced for the response
object that will run a processing function like so if you wanted to do compression:
CacheableRequest.addHook('response', async (response: any) => {
const buffer = await pm(gunzip)(response);
return buffer.toString();
});
const cacheableRequest = CacheableRequest(request, cache);
How to Add a Hook: https://github.com/jaredwray/cacheable-request#add-hooks
How to Remove a Hook: https://github.com/jaredwray/cacheable-request#remove-hooks
We would love some feedback on this feature!
Change Log
- support esm by @alphmth in #145
- Moving to pure ESM by @jaredwray in #147
- upgrading jest and ts-node to latest by @jaredwray in #148
- fixed for 304 by @alphmth in #149
- upgrading ts-node to 10.9.1 by @jaredwray in #151
- upgrading xo to 0.51.0 by @jaredwray in #152
- upgrading jest and modules to latest by @jaredwray in #153
- upgrading @keyv/sqlite to 3.5.3 and sqlite3 to 5.0.10 by @jaredwray in #154
- upgrading keyv to 4.3.3 by @jaredwray in #155
- upgrading responseLink to 3.0.0 by @jaredwray in #156
- Issue 95 by @alphmth in #157
- upgrading sqlite3 to 5.0.11 by @jaredwray in #158
- upgrading eslint-plugin-jest to 26.7.0 by @jaredwray in #159
- Create PULL_REQUEST_TEMPLATE.md for use on pull requests by @jaredwray in #160
- upgrading @types/node and eslint-plugin-jest to latest by @jaredwray in #161
- removing console.log from tests by @jaredwray in #162
- added hook for pre computation on response by @alphmth in #163
- upgrading @types/node to 18.7.3 by @jaredwray in #164
Full Changelog: v8.3.1...v9.0.0