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

sync-disk-cache

Package Overview
Dependencies
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sync-disk-cache

sync disk cache

  • 1.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
147K
decreased by-60.85%
Maintainers
1
Weekly downloads
 
Created

What is sync-disk-cache?

The sync-disk-cache npm package provides a simple, synchronous API for caching data to disk. It is useful for scenarios where you need to store and retrieve data quickly without the overhead of asynchronous operations.

What are sync-disk-cache's main functionalities?

Set Cache

This feature allows you to set a key-value pair in the cache. The data is stored on disk and can be retrieved later.

const Cache = require('sync-disk-cache');
const cache = new Cache('myCache');
cache.set('key', 'value');

Get Cache

This feature allows you to retrieve a value from the cache using its key. If the key exists, the value is returned; otherwise, it returns null.

const Cache = require('sync-disk-cache');
const cache = new Cache('myCache');
const result = cache.get('key');
console.log(result.value);

Remove Cache

This feature allows you to remove a key-value pair from the cache. The specified key and its associated value are deleted from the disk.

const Cache = require('sync-disk-cache');
const cache = new Cache('myCache');
cache.remove('key');

Clear Cache

This feature allows you to clear all key-value pairs from the cache. The entire cache is emptied, removing all stored data from the disk.

const Cache = require('sync-disk-cache');
const cache = new Cache('myCache');
cache.clear();

Other packages similar to sync-disk-cache

Keywords

FAQs

Package last updated on 10 Mar 2017

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