Skip to content

Commit 326a7f9

Browse files
Update README.md
1 parent c21e61b commit 326a7f9

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

README.md

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,22 @@
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+
```
1122
async 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!

0 commit comments

Comments
 (0)