storage-utilities

0.0.2 • Public • Published

storage-utilities

Usage

import { parse, stringify } from 'storage-utilities'
 
// Sample of what localStorage might be.
const localStorage = {
  foo: "muahaha",
  fee: "[0, 1, 2]"
}
 
const foo: string = parse(localStorage.getItem('foo'))
// "muahaha"
 
const fee: number[] = parse(localStorage.getItem('fee'))
// [0, 1, 2]
 
const bar: string = stringify({ name: 'Tommy' })
// "{ name: 'Tommy' }"
 
const baz: string = stringify("yolo")
// "yolo"
 

Package Sidebar

Install

npm i storage-utilities

Weekly Downloads

319

Version

0.0.2

License

none

Unpacked Size

3.25 kB

Total Files

8

Last publish

Collaborators

  • colshacol