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

receptacle

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

receptacle - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

4

index.js
module.exports = Receptacle;
var cache = Receptacle.prototype;
var counter = new Date % 1e9;
function getUID () { return (Math.random() * 1e9 >>> 0) + (counter++); }
/**

@@ -14,2 +17,3 @@ * Creates a cache with a maximum key size.

options = options || {};
this.id = options.id || getUID();
this.max = options.max || Infinity;

@@ -16,0 +20,0 @@ this.items = options.items || [];

2

package.json
{
"name": "receptacle",
"version": "0.1.0",
"version": "0.1.1",
"description": "In memory cache lru cache with ttl support.",

@@ -5,0 +5,0 @@ "author": "Dylan Piercey <pierceydylan@gmail.com>",

@@ -45,5 +45,8 @@ # Receptacle.

###`Receptacle({ max=Infinity, items=[] })`
###`Receptacle({ max=Infinity, items=[], id=# })`
Create a new cache.
###`#id`
Each cache is assigned a unique id for organizing, you can optionally provide an id during instanciation.
###`#max`

@@ -50,0 +53,0 @@ Get the maximum size of the cache (default of Infinity).

@@ -12,2 +12,3 @@ var assert = require("assert");

assert.equal(cache.has("b"), true);
console.log(cache);
});

@@ -14,0 +15,0 @@

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