Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/eekelof/BunnyDB
JSON database for Bun
https://github.com/eekelof/BunnyDB
Last synced: 2 months ago
JSON representation
JSON database for Bun
- Host: GitHub
- URL: https://github.com/eekelof/BunnyDB
- Owner: eekelof
- License: mit
- Created: 2024-08-03T15:21:07.000Z (3 months ago)
- Default Branch: main
- Last Pushed: 2024-08-04T21:53:19.000Z (3 months ago)
- Last Synced: 2024-09-05T05:41:08.999Z (2 months ago)
- Language: TypeScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# BunnyDB
JSON database for Bun[![npm](https://img.shields.io/npm/v/bunnydb)](https://www.npmjs.com/package/bunnydb)
[![npm](https://img.shields.io/npm/dm/bunnydb)](https://www.npmjs.com/package/bunnydb)
[![GitHub](https://img.shields.io/github/license/eekelof/bunnydb)](https://github.com/git/git-scm.com/blob/main/MIT-LICENSE.txt)## Features
- :rabbit: Works with Bun
- :zap: Zero dependencies
- :gear: JSON files in regular folders## Installation
```bash
bun i bunnydb
```## Usage
```typescript
import { BunnyDB } from "bunnydb"await BunnyDB.dir("users") // true/false
await BunnyDB.set("users", "id", {id: "id", name: "Bob"}) // true/false
await BunnyDB.remove("users", "id") // true/false
await BunnyDB.exists("users", "id") // true/falseawait BunnyDB.get("users", "id") // any/null
await BunnyDB.getAllIDs("users") // []
await BunnyDB.getAll("users") // []
```### Notes
#### Use / when creating nested dirs
```typescript
await BunnyDB.dir("db")
await BunnyDB.dir("db/users")
await BunnyDB.dir("db/nested/dir")
```## License
MIT