File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55` npm install simple-github-db `
66## Usage
77
8+ #### Create database
89```
9- const GithubDb=require("simple-github-db");
10+ (async function(){
11+ try {
12+ await GithubDb.createDatabase(<DATABASE_NAME>,<TOKEN>)
13+ await test();
14+ } catch (error) {
15+ console.error(error);
16+ }
17+ })()
1018
19+ ```
20+ #### CRUD Operation
21+ ```
1122async function test(){
12- const db= GithubDb({db:process.env.db ,token:process.env.token });
23+ const db= GithubDb({db:<DATABASE_NAME> ,token:<TOKEN> });
1324
1425 const {identifier}=await db.add({document:"user"},{name:"John"});
1526 console.log("added user", identifier);
@@ -30,7 +41,6 @@ async function test(){
3041
3142(async function(){
3243 try {
33- await GithubDb.createDatabase(process.env.db,process.env.token)
3444 await test();
3545 } catch (error) {
3646 console.error(error);
@@ -59,4 +69,4 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
5969
6070<!-- ALL-CONTRIBUTORS-LIST:END -->
6171
62- This project follows the [ all-contributors] ( https://github.com/all-contributors/all-contributors ) specification. Contributions of any kind welcome!
72+ This project follows the [ all-contributors] ( https://github.com/all-contributors/all-contributors ) specification. Contributions of any kind welcome!
You can’t perform that action at this time.
0 commit comments