Skip to content

Westixy/nodbstore-gist

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NoDbStore-gist

NoDB storage using gist as persistent mode

You need to create a gist manually to obtain his id

Getting started

You can define these two keys in your environnement :

NODB_GIST_ID=
NODB_GIST_TOKEN=

Install with npm i nodbstore nodbstore-gist

const NoDB = require('nodbstore')

// create a store
const NoDBStoreGist = require('nodbstore-gist')
const store = new NoDBStoreGist()

// if you want to use another token / gistId / database name
const store = new NoDBStoreGist({gistId, token, name})
// no one are necessary if you use only the gistId 
//   the token stored in the environement will be used

// add the store to the db
const db = new NoDB()
db.addStore(store)

// you can change the time between two save with (ms)
store.minUpdate = 3000

// load the database
store.load().then(()=>{
  db.put({addMore: 'data'})
}).catch(console.error)

About

Store for NoDB using gists as persitent method

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •