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

@beoe/cache

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@beoe/cache

Shareable persistent LRU TTL cache based on SQLite

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
0
Created
Source

@beoe/cache

[!WARNING] One of ideas was to use this as shared cache inside Astro components. But for now it doesn't work. If it is used inside Astro component build process (prerendering) fails. Though it does work in rehype/remark plugins. And in Astro components in development mode.

Probably would need to create custom Astro integration (virtual module), but hard to tell because I don't understand why it fails

Thin wrapper arround @beoe/sqlitecache so the same cache can be shared between different rehype/remark plugins and Astro components

Because cache would be "hidden" inside other packages it exposes way to configure instance through local file (with cosmiconfig).

By default it stores cache in node_modules/.beoe folder. This will make it easy to use, node_modules often cached in CI and added to .gitignore. On the other hand I haven't seen this approach before, there can be downsides that I haven't thought about.

You can change where cache is stored using configuration (beoe.config.mjs):

import { defineConfig } from "@beoe/cache";

export default defineConfig({
  database: "other_folder/cache.sqlite",
});

Usage

import { getCache } from "@beoe/cache";

const cache = await getCache();

TODO

  • tests
  • write documentation about configuration options

Alternatives

Keywords

FAQs

Package last updated on 30 Nov 2024

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