Thanks to visit codestin.com
Credit goes to github.com

Skip to content

acathur/store

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Store

A key-value store that persists on disk for Deno.

Requires the --allow-read and --allow-write flags.

Usage

import { Store } from 'https://cdn.depjs.com/store/mod.ts'

const store = new Store()

await store.set('username', 'deno')

await store.get('username')
// --> deno

await store.set({
  username: 'acathur',
  age: 25
})

await store.delete('username')

await store.toObject()
// --> { age: 25 }

await store.clear()

You can also initialize a new Store with the given name and path.

const store = new Store('mystore')

// or
const store = new Store({
  name: 'cachedata',
  path: './store'
})

API

  • .set(key, value)
  • .get(key)
  • .has(key)
  • .delete(key)
  • .clear()
  • .toObject()

License

MIT

Copyright (c) 2020, Acathur

About

A key-value store that persists on disk for Deno.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •