inmemorymemoize
v1.1.2
Published
nodejs InMemoryMemoize
Downloads
4
Maintainers
Readme
InMemoryMemoize
nodejs InMemoryMemoize is a key => value memoization package with no other dependancies which makes use of latest javascript technologies
Installation
Install InMemoryMemoize with npm
npm i inmemorymemoize
Features
- Light weight
- no dependancies
- Typescript support
- in memory memoization
- multiple memory stores
- supports Stream
Documentation
// ES6
import { InMemoryMemoize } from "inmemorymemoize";
// CommonJS
const { InMemoryMemoize } = require("inmemorymemoize");
How to
- first you have to create a new instance of your memoization memory
javascript
const user = new InMemoryMemoize(name, options);
TypeScript
const user = new InMemoryMemoize<string | number>(name, options);
InMemoryMemoize constructor accepts two parameters
name
is a string which denotes the memory name and options
is an optional parameter which is an object to configure the memory if needed.
- Add entries to the memory
user.add("name", "john");
Note:
instance.add(key, value)
method can also be chained.
user.add("name", "john").add("age", 25).add("gender", "male");
instance.add(key, value)
method always accepts two parameters. a key and a value. key
should always be a string
. and value
can be of any javascript type
Badges
Authors
Support
For support, email [email protected]
Tech Stack
Client: not-supported currently
Server: Node
🚀 About Me
I'm a full stack developer...
Hi, I'm Amalu! 👋
🛠 Skills
Javascript, HTML, CSS, JQuery, SASS, TypeScript, NodeJS, EXPRESS, MongoDB, GraphQL, TypeGraphQL, DynamoDB