- Simple file-backed storage - One JSON file, no database server needed.
- Everyday data work - Insert, read, update, delete, clear, and reload.
- Flexible filtering - Chain filters, then read or modify matching.
- Structured records - Query and update nested object fields easily.
Note
Prerequisites: For Deno (install from deno.com). For npm use Node.js (e.g. nodejs.org).
Deno (JSR):
deno add jsr:@neabyte/jsonarynpm:
npm install @neabyte/jsonaryCreate a database instance and start inserting/querying objects.
import Jsonary from '@neabyte/jsonary' // Initialize database file (auto-created on first write) const db = new Jsonary({ path: './data.json' }) // Insert one record db.insert({ name: 'John', age: 30 }) // Insert many records db.insertMany([ { name: 'Jane', age: 25 }, { name: 'Bob', age: 35 } ]) // Filter records with string condition const adults = db.where('age >= 18').get() // Get first matching record const firstJohn = db.where('name = John').first()- USAGE.md for more examples and query operator details.
npm build (bundles to dist/):
npm run buildType check — format, lint, and type-check:
deno task checkUnit tests — format/lint tests and run all tests:
deno task test- Tests live under
tests/(public API tests intests/jsonary.test.ts). - The test task uses
--allow-read,--allow-write, and--allow-env.
This project is licensed under the MIT license. See the LICENSE file for details.