Skip to content

kaxifakl/DBhub

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DBhub

Use Github as a mini-database

start

npm i @movingcastle/dbhub
test.ts
import { DBhub } from "@movingcastle/dbhub";

let db = new DBhub({
    authToken: 'xxxxxx',  //your github token
    dbs: [                //dbbase name or path
        "test"
    ],
    owner: "xxx",         //your github name
    repo: "xxx"           //your github repo name
})

db.connect(() => {
    //change some data
    db.setData('test', 'testabc', { num: 123456 })
    //sync this github db
    db.sync(()=>{
        console.log('finish')
    });
})

create or delete

just create a file named xxx.raw

delete the file on github.com

notice

Dont make the file too large, it will cause some problems

About

Use Github as a mini-database

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published