Socket
Socket
Sign inDemoInstall

localstorage

Package Overview
Dependencies
0
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    localstorage

serialize, deserialize and namespace JSON


Version published
Weekly downloads
1.1K
increased by1.63%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

SYNOPSIS

A localStorage helper. Serialize and deserialize JSON, add namspaces, check for keys not found.

INSTALL

npm install voltraco/localstorage

USAGE

const LocalStorage = require('localstorage')
const user = new LocalStorage('user') // create the `user` namespace

user.put('quxx', { foo: 100 })

user.get('quxx') // [null, { foo: 100 }]
user.get('foo') // [ErrorNotFOund]

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

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

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

FAQs

Last updated on 30 Mar 2018

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc