A utility for exporting and importing axios-cache-adapter cache stores to/from JSON files, enabling persistent cache across restarts or sharing between processes. Current version 1.0.57, with weekly releases. Key differentiators: built-in process exit hook integration, TypeScript support, and direct filesystem operations via fs-extra. Requires peer dependencies axios (^0.21.1) and axios-cache-adapter (^2.7.3). Commonly used to save API cache to disk and reload on app startup.
npm install axios-cache-adapter-utilNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initialize cache adapter, load existing cache from JSON file, make a request, then save updated cache back to file.
Upgrade axios to ^0.21.1 and axios-cache-adapter to ^2.7.3.
Pass a callback function to exportCache that receives JSON and writes it to file.
Use await or .then() when calling importCache.
Call exportCache explicitly instead of relying on exit hook.
Run npm install axios-cache-adapter-util or yarn add axios-cache-adapter-util.
Ensure axios-cache-adapter version 2.7.3 or newer is installed.
Use import { exportCache } from 'axios-cache-adapter-util' (ESM) or const { exportCache } = require('axios-cache-adapter-util') (CJS) consistently.