New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

omni-cache

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

omni-cache

Memory cache for server side

latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
1
Created
Source

omni-cache

NPM Version NPM Downloads Maintenance GitHub issues


Simple memory cache from server side.


How to

Install

npm i --save omni-cache
or
yarn add omni-cache

Use

Without options on create


const { Cache } = require('omni-cache');

const cache = new Cache();

cache.put('myKey', 'myValue', 1500);              // Time im ms
cache.get('myKey');                               // myValue
cache.keys();                                     // [ 'myKey' ]
cache.size();                                     // 1
cache.debug(true);                                // No return
cache.inDebug();                                  // true
cache.exportJson();                               // true
cache.del('myKey');                               // true
cache.clear();                                    // No return

With options on create


const { Cache } = require('omni-cache');

const cache = new Cache({
  debug: true,
  ttl: 1500
});

cache.put('myKey', 'myValue');                    // Expire time id ttl by default
cache.get('myKey');                               // myValue
cache.keys();                                     // [ 'myKey' ]
cache.size();                                     // 1
cache.inDebug();                                  // true
cache.debug(false);                               // No return
cache.inDebug();                                  // false
cache.exportJson();                               // true
cache.del('myKey');                               // true
cache.clear();                                    // No return


npm

Keywords

cache

FAQs

Package last updated on 29 Apr 2020

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