Skip to content

Commit

Permalink
📝 Added usage information
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianHeidenreich committed Dec 19, 2020
1 parent 9d116ef commit 8cd69b5
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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();
```

0 comments on commit 8cd69b5

Please sign in to comment.