https://github.com/alexstevovich/chabrador
[Node.js] A key-incrementer database with persistent memory across process resets.
https://github.com/alexstevovich/chabrador
database logging memory nodejs
Last synced: about 1 year ago
JSON representation
[Node.js] A key-incrementer database with persistent memory across process resets.
- Host: GitHub
- URL: https://github.com/alexstevovich/chabrador
- Owner: alexstevovich
- License: apache-2.0
- Created: 2025-03-13T18:32:05.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-13T18:43:46.000Z (over 1 year ago)
- Last Synced: 2025-05-21T01:59:43.773Z (about 1 year ago)
- Topics: database, logging, memory, nodejs
- Language: JavaScript
- Homepage:
- Size: 92.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
Awesome Lists containing this project
README
# Chabrador

**Chabrador** is a **key-incrementer database** with persistent memory across process resets.
## Features
- **In-Memory Data Handling** – Memory persists when process resets.
- **Overflow Protection** – Limits can be applied to stop theoretical endless growth.
## Installation
```bash
npm install chabrador
```
## Usage
```js
import { adopt } from 'chabrador';
const chabrador = await adopt({
filePath: 'data.json',
backupInterval: 600000, // 10 minutes
maxEntries: 100000,
logger: console,
});
chabrador.boop('unique-id');
```
## API
### boop(id: string)
Increments a key value by 1 If the key exists otherwise it creates a new entry set at 0. The timestamp of the last boop is recorded.
### adopt()
Creates a new Chabrador instance and initializes memory from a file.
## Development Homepage:
[https://github.com/alexstevovich/chabrador](https://github.com/alexstevovich/chabrador)
_This link might become chabrador-node in the future if conflicts arise._
## License
Licensed under the [Apache License 2.0](https://www.apache.org/licenses/LICENSE-2.0).