Socket
Socket
Sign inDemoInstall

file-system-cache

Package Overview
Dependencies
Maintainers
1
Versions
30
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-system-cache

A super-fast, promise-based cache that reads and writes to the file-system.


Version published
Weekly downloads
3.6M
decreased by-20.55%
Maintainers
1
Weekly downloads
 
Created

What is file-system-cache?

The file-system-cache npm package provides a simple and efficient way to cache data on the file system. It allows you to store, retrieve, and manage cached data, making it useful for applications that need to cache data locally to improve performance and reduce redundant operations.

What are file-system-cache's main functionalities?

Set Cache

This feature allows you to set a value in the cache with a specific key. The code sample demonstrates how to set a cache entry with the key 'key' and the value 'value'.

const FileSystemCache = require('file-system-cache');
const cache = FileSystemCache.default();

cache.set('key', 'value').then(() => {
  console.log('Cache set successfully');
});

Get Cache

This feature allows you to retrieve a value from the cache using a specific key. The code sample demonstrates how to get the cached value for the key 'key'.

const FileSystemCache = require('file-system-cache');
const cache = FileSystemCache.default();

cache.get('key').then(value => {
  console.log('Cached value:', value);
});

Remove Cache

This feature allows you to remove a specific entry from the cache using its key. The code sample demonstrates how to remove the cache entry for the key 'key'.

const FileSystemCache = require('file-system-cache');
const cache = FileSystemCache.default();

cache.remove('key').then(() => {
  console.log('Cache removed successfully');
});

Clear Cache

This feature allows you to clear all entries from the cache. The code sample demonstrates how to clear the entire cache.

const FileSystemCache = require('file-system-cache');
const cache = FileSystemCache.default();

cache.clear().then(() => {
  console.log('Cache cleared successfully');
});

Other packages similar to file-system-cache

Keywords

FAQs

Package last updated on 26 Aug 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