🚀 Launch Week Day 5:Introducing Immutable Scans.Learn More →
Socket
Book a DemoInstallSign in
Socket

lcache

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lcache

a cache library

latest
Source
npmnpm
Version
1.0.3
Version published
Maintainers
1
Created
Source

LCache

a cache library

install

$ npm install lcache

or

$ yarn add lcache

usage

new instance

  import LCache from 'lcache';
  var lcache = new LCache(100);

or

const LCache = require('lcache').default;

put a new entry

lcache.put('key', value);
if the size is over the limit, return the head

get an existed entry

lcache.get('key');
return undefined if the key is not exists

remove an entry

lcache.shift('key')
remove the specified entry or the head if key is undefined

FAQs

Package last updated on 30 Nov 2018

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