LevelKV
A simple native Node.js implementation of the well-known key-value based LevelDB library.
Installation
npm i levelkv
Examples
// Open a databaseconst LevelKV DBMutableCursor = ;const db = await LevelKV; let key = 'key';let value = a:1 b:2 c:3 ; // Add dataawait db;await db; // Get datalet result = await db;console;console; // Delete dataawait db; // Get all dataresult = await db;for await let value of result console; // Use Mutable Cursorconst dbCursor = await db;const segments = dbCursorsegments;for let segment of segments segment_in = false; segment_v = 'newValue';console; // Close the databaseawait db;
Notice
All the operations in LevelKV are asynchronous, remember to add await
keyword in front of the function call if you need.
Operations
Open A Database
/** * Initialize the database. * * @async * @param * @param * @returns */
Close A Database
/** * Close the database. * * @async */
Reads And Writes
/** * Get data from the database. * * @async * @param * @returns */
/** * Add data to the database. * * @async * @param * @param */
/** * Delete data from the database. * * @async * @param */
For Maintainer
Install Project
- Clone Project:
git clone <project-url>
- Install Dependency Packages:
npm install