-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9d116ef
commit 8cd69b5
Showing
1 changed file
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
<p align="center"> | ||
A lightweight, develoepr friendly, key-value persistant storage solution for Deno projects</a>. | ||
<br /> | ||
<a href="https://dsddb.mod.land"><strong>Explore the docs »</strong></a> | ||
<a href="https://doc.deno.land/https/deno.land/x/dsddb/mod.ts"><strong>Explore the docs »</strong></a> | ||
<br /> | ||
<br /> | ||
<a href="https://github.com/MaximilianHeidenreich/DsDDB/issues">Report Bug</a> | ||
|
@@ -39,3 +39,27 @@ If you want to use it, please check out the docs for the project. | |
- Don't include anything else other than Deno std | ||
|
||
<br></br> | ||
|
||
<!-- USAGE --> | ||
## Usage | ||
|
||
This is the most basic example to get DsDDB up and running within your project. For further infroamtion check out the [API Documentation](https://doc.deno.land/https/deno.land/x/dsddb/mod.ts). | ||
|
||
```TypeScript | ||
// 1. Add import to your deps.ts | ||
export { DsDDB } from "https://deno.land/x/[email protected]/mod.ts"; | ||
|
||
// 2. Create new DsDDB instance | ||
const database = new DsDDB(); | ||
|
||
// 3. Load from disk | ||
await database.load(); | ||
|
||
// 4. Use database | ||
if (!database.exists("myKey")) database.set("myKey", "Hello World"); | ||
|
||
console.log(database.get("myKey")); | ||
|
||
// 5. Write data to disk | ||
await database.write(); | ||
``` |