Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

axios-cache-adapter-fs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

axios-cache-adapter-fs

Use the local File System as a Store for axios-cache-adapter

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

🚀 axios-cache-adapter-fs

Use the local File System as a Store for axios-cache-adapter.

This is built to enable easy caching on disk when building scripts that you intend to run in your local system only.

Install

Using npm

npm install --save axios-cache-adapter-fs

Usage

You can give a FileStore instance to axios-cache-adapter which will be used to store cache data instead of the default in-memory store.

import axios, { AxiosRequestConfig } from "axios"
import { setupCache } from "axios-cache-adapter"
import FileStore from "axios-cache-adapter-fs"

// `axios-cache-adapter` options
const instanceCache = setupCache({
    store: new FileStore(),
})

// `axios` options
const config: AxiosRequestConfig = {
    baseURL: "https://example.com",
    adapter: instanceCache.adapter,
}

const httpClient = axios.create(config)

const response = await httpClient.get("/url")

Important note: Only GET request results are cached by default. Executing a request using any method listed in exclude.methods will invalidate the cache for the given URL.

Refer axios-cache-adapter's docs for further details.

Keywords

FAQs

Package last updated on 06 Jun 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc