save-local
v0.2.3
Published
Save stuff locally
Downloads
20
Maintainers
Readme
save-local
Save stuff locally
Install
$ yarn add save-local
Usage
const SaveLocal = require('save-local')
const saveLocal = new SaveLocal('store')
// you must call saveLocal.init() to initialize the instance
await saveLocal.init()
saveLocal.set({ name: 'token', value: 'my-token' })
saveLocal.get('token').then(value => console.log(value))
// => my-token
API
SaveLocal(input)
Returns a constructor
input
Type: string
Required
store name
methods
.init()
Returns a promise
Initializes the local store
.set([options])
Returns a promise
Save and encrypt an item on local store
options
Type: object
Required
name
Type: string
Required
name of the item to be saved
value
Type: string
Required
value of the item to be saved
.get(input)
Returns a promise
Get and dencrypt an item saved on local store
input
Type: string
Required
name of the item saved
.remove(input)
Returns a promise
Remove an item saved on local store
input
Type: string
Required
name of the item saved
.list()
Returns a promise
Get an array with all names
and values
Related
- save-me — CLI for this module
- git-labels — Creating Github issue labels
- git-labels-cli — Creating Github issue labels CLI
License
MIT © Bu Kinoshita