Baselet is a lightweight, file-system based database library for JavaScript and TypeScript applications, currently at version 0.3.0. It leverages `disklet` for persistent storage, allowing it to store data directly on disk without requiring external database servers. This makes it suitable for embedded applications, local storage, or serverless environments where a simple, durable key-value or document store is needed. Its primary differentiators include its small footprint, direct disk interaction via `disklet`, and a focus on simplicity. As a 0.x package, it is still under active development, and its API might evolve with subsequent minor versions, though a regular release cadence isn't yet established. Developers should anticipate potential API adjustments.
npm install baseletVerified import paths — ran on the pinned version, not inferred.
Initializes an in-memory Baselet database, demonstrating how to store and retrieve JSON objects and raw text. Requires `disklet`.
Refer to the official GitHub repository's changelog or latest source code for API updates between versions. Pinning to exact patch versions is recommended for stability.
For persistent storage, ensure you use a file-system based disklet (e.g., `makeNodeDisklet` for Node.js or `makeReactNativeDisklet` for React Native) and provide a stable, writable path.
Always use the Baselet API methods (e.g., `setJson`, `getJson`, `delete`) for all data operations within its managed database path to ensure data integrity.
Ensure you are calling `makeBaselet` correctly with a `Disklet` instance and a string path, and that `Baselet` is properly imported and the correct methods are being called.
Choose a new, empty directory path for your Baselet instance, or ensure the existing path is a writable directory and not a file.
Run `npm install baselet disklet` or `yarn add baselet disklet` to ensure both Baselet and its core `disklet` dependency are installed and available.