Skip to content

Serialize, deserialize and namespace JSON in localstorage.

Notifications You must be signed in to change notification settings

voltraco/localstorage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

SYNOPSIS

Serialize and deserialize and namespace JSON in localstorage.

INSTALL

npm install localstorage

USAGE

const LocalStorage = require('localstorage')
const foo = new LocalStorage('foo') // create a `foo` namespace
foo.put('quxx', { foo: 100 })
const [err, value] = foo.get('quxx')
value.foo === 100 // true
foo.get('quxx') // [null, { foo: 100 }]
foo.get('foo') // [ErrorNotFOund]

foo.has('quxx') // [null, true]
foo.has('foo') // [ErrorNotFound]

foo.delete('quxx') // [null, true]
foo.delete('foo') // [ErrorNotFound]

foo.delete() // delete everything in the `foo` namespace

About

Serialize, deserialize and namespace JSON in localstorage.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages