Socket
Socket
Sign inDemoInstall

cacha

Package Overview
Dependencies
9
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cacha

My hunky-dory module


Version published
Weekly downloads
8
decreased by-27.27%
Maintainers
1
Install size
84.2 kB
Created
Weekly downloads
 

Readme

Source

cacha Build Status

Cache on file-system

Install

$ npm install --save cacha

Usage

const Cache = require('cacha');
const cache = new Cacha('.my/cache');

cache.set('id', 'content');
//=> Promise

cache.get('id');
//=> Promise with 'content'

API

cacha(namespace, [options])

namespace

Type: string

Directory in HOME or TMP directory of current user.

If namespace begins with / it will be interpreted as absolute path.

options
ttl

Type: Number
Default: 86400000

How long (in milliseconds) keep entries in cache.

cache.get(id, [options])

cache.getSync(id, [options])

cache.set(id, content, [options])

cache.setSync(id, content, [options])

Get and set methods for cache entries. options are passed to fs write and read methods (for example to specify encoding).

cache.clean()

Removes outdated entries in cache.

License

MIT © Vsevolod Strukchinsky

FAQs

Last updated on 15 Nov 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc