0.0.9 • Published 9 months ago

@justinmusti/storage v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

@justinmusti/storage

This is a platform-agnostic storage utility class.

Supported environments: Node Browser

How to Use

import

import {Storage} from "@justinmusti/storage"

Init

// Browser
const storage = new Storage()

// Node
const storage = new Storage({path: "path-to-file-to-write-to"})

Create entry in storage

storage.set("test", "hello")
// Browser: localStorage now has `test` entry with value 'hello'
// Node: file at provided path now has `test` entry with value 'hello'

Check if storage has key

storage.has('uploadURL') // returns true or false

Delete key from storage.

storage.removeitem('test')
storage.has('test')  // Now this returns false.

Remove all/Clear

storage.clear()
// All entries are removed.
0.0.9

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.8

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.1

10 months ago