JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1598
  • Score
    100M100P100Q108821F
  • License MIT

My hunky-dory module

Package Exports

  • cacha

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cacha) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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