New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

node-keyv-fetch-cache

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-keyv-fetch-cache

This package allows you to use [keyvhq](https://github.com/microlinkhq/keyvhq) with [node-fetch-cache](https://github.com/mistval/node-fetch-cache), enabling access to all kind of different caching mechanisms like redis, mongo, sqlite, postgres etc.

latest
npmnpm
Version
0.0.1
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

This package allows you to use keyvhq with node-fetch-cache, enabling access to all kind of different caching mechanisms like redis, mongo, sqlite, postgres etc.

To use try the following,

pnpm i node-keyv-fetch-cache
import { fetchBuilder } from "node-fetch-cache";
import KeyvSQLite from "@keyvhq/sqlite";
import { KeyvFetchCache } from "node-keyv-fetch-cache"

// create a backing store for the cache
const store = new KeyvSQLite("sqlite://path/to/datastore.sqlite");
// use the store with keyv to create a cache, defaults to a in-memory store
const cache = new KeyvFetchCache({ store });
// create fetch with the cache we just created
const fetch = fetchBuilder.withCache(cache);

// let's check your IP or any other kind of request
// run the command multiple time to ensure it gets data from the store
fetch("http://httpbin.org/ip")
  .then((data) => data.text())
  .then(console.log);

FAQs

Package last updated on 13 Nov 2023

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