KiritoDB Remote is a simple, key-value remote database designed for Node.js environments, including bots and APIs. It allows developers to store and retrieve data using dot-notation paths, similar to object property access (e.g., `"users.1234.points"`). As of version 1.0.36, it provides a straightforward API for common database operations such as `get`, `set`, `add`, `sub`, and `delete`. A key characteristic of this library is that all its documentation and examples are provided exclusively in Portuguese, catering specifically to the Brazilian Portuguese-speaking developer community. While explicit release cadence information is not available, its consistent versioning suggests ongoing maintenance. Its primary differentiator is its focus on simplicity and accessibility for Portuguese-speaking developers, offering a remote storage solution without the overhead of more complex database systems.
npm install kirito.db.remoteVerified import paths — ran on the pinned version, not inferred.
Demonstrates initializing KiritoDB, setting and getting data for various keys, performing numeric addition and subtraction, retrieving all stored data, and deleting specific keys. Requires setting `KIRITO_DB_SECRET_KEY` environment variable.
Before using `add` or `sub`, ensure that the target key's value is, and remains, a number. Initialize numeric keys with a default number (e.g., 0) if they might not exist to prevent type errors.
Always prepend `await` when invoking `db.get('key')` or `db.all()` within an `async` function to ensure the operation completes and returns the expected data.Obtain a valid secret API key from the KiritoDB service and pass it as the first argument to `new KiritoDB('your_secret_key')`. Ensure this key is kept secure and not exposed publicly.For maximum compatibility and reliability, prefer setting primitive types (strings, numbers, booleans) directly. If complex data structures like arrays or objects must be stored, consider serializing them into JSON strings (e.g., `JSON.stringify(value)`) before storing and deserializing upon retrieval (e.g., `JSON.parse(retrievedValue)`).
Ensure you provide your secret key as a non-empty string when initializing: `new KiritoDB('your_secret_key')`. Validate the key's correctness.Always use `await` before calls to `db.get()` and `db.all()` to ensure the Promise resolves and returns the actual data before further processing.
Confirm that the target key exclusively stores numeric values before using `db.add()` or `db.sub()`. Consider initializing keys with a numeric default if they might be empty, or validating the type before performing arithmetic operations.
No dependency data recorded yet.