Skip to content

About

A tiny module to store data in memory with a persistance layer using localStorage

Resources

Stars

0 stars

Watchers

2 watching

Forks

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Storage in memory

A tiny module to only read/write localStorage whenever neccessary, and else keeping data in memory. It also handles converting data so you can pass objects/arrays into it.

Install

npm install https://github.com/peermusic/in-memory-storage
var storage = require('in-memory-storage')

For reference see the Browserify Handbook.

Usage

var storage = require('in-memory-storage')

// Read a key from memory or localStorage, with an optional default
storage.get('key', {})

// Set a key in memory and localStorage
storage.set('key', {id: 1, name: 'Test'})

// Remove a key from memory and localStorage
storage.remove('key')

About

A tiny module to store data in memory with a persistance layer using localStorage

Resources

Stars

0 stars

Watchers

2 watching

Forks

Releases

Packages

Contributors

Languages