{"library":"rocket-store","title":"Rocket-Store","description":"Rocket-Store is a lightweight, high-performance flat-file database solution for Node.js, currently at version `0.10.20`. It distinguishes itself by directly leveraging the host operating system's file system caching mechanisms for exceptionally fast data storage and retrieval. Designed for scenarios requiring minimal footprint and high throughput, it stores data in JSON format within collections and records, accessible via unique keys. The package requires no complex configuration or setup, defaulting to the OS temporary directory for data storage, and supports both CommonJS and ES Modules. While specific release cadence isn't explicitly defined, frequent updates indicate active maintenance. Its key differentiators include simplicity, asynchronous mutation safety, and a single-file core with few external dependencies, making it an efficient alternative to more complex database systems for specific use cases.","language":"javascript","status":"active","last_verified":"Wed Apr 22","install":{"commands":["npm install rocket-store"],"cli":null},"imports":["const rs = require('rocket-store').default;","import * as store from 'rocket-store';\nconst rs = await store.Rocketstore();","import defaultStore from 'rocket-store';\nconst rs = await defaultStore();","import type { RocketStoreInstance, RocketStoreOptions, RocketStoreResult } from 'rocket-store';"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import * as rsModule from 'rocket-store';\nimport type { RocketStoreInstance } from 'rocket-store';\nimport { join } from 'path';\nimport { tmpdir } from 'os';\n\nconst main = async () => {\n  const rs: RocketStoreInstance = await rsModule.Rocketstore();\n\n  // Set a custom storage directory (optional, defaults to OS temp dir)\n  await rs.setOption({ data_storage_area: join(tmpdir(), 'my-rocket-data') });\n\n  // 1. Post a record\n  const postResult = await rs.post(\"cars\", \"Mercedes-C200\", { owner: \"Lisa Simpson\", reg: \"N3RD\" });\n  console.log('Posted Mercedes:', postResult);\n\n  // 2. Post another record with an auto-incremented key\n  const postResult2 = await rs.post(\"cars\", null, { owner: \"Homer Simpson\", reg: \"DUFF\" }, rs._ADD_AUTO_INC);\n  console.log('Posted Homer (auto-inc key):', postResult2);\n\n  // 3. Get all records from the 'cars' collection, ordered descending\n  const allCars = await rs.get(\"cars\", \"*\", rs._ORDER_DESC);\n  console.log('All cars (descending):', allCars);\n\n  // 4. Get a specific record by key\n  const mercedes = await rs.get(\"cars\", \"Mercedes-C200\");\n  console.log('Mercedes record:', mercedes);\n\n  // 5. Delete records matching a wildcard pattern (e.g., all with 'Cede' in key)\n  const deleteResult = await rs.delete(\"cars\", \"*cede*\");\n  console.log('Deleted records matching *cede*:', deleteResult);\n\n  // 6. Get remaining records\n  const remainingCars = await rs.get(\"cars\", \"*\");\n  console.log('Remaining cars:', remainingCars);\n};\n\nmain().catch(console.error);","lang":"typescript","description":"Demonstrates basic setup, configuring the storage area, and performing CRUD operations (post, get, delete) with specific keys and wildcard searches.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}