{"id":41339,"library":"json-orm","title":"JSON-ORM","description":"A lightweight, zero-dependency Node.js library (version 1.0.0, released 2023) for querying and manipulating JSON data structures using an ORM-like interface. Provides CRUD operations with both synchronous and asynchronous APIs, querying by key-value pairs with support for wildcards and regular expressions, dot-notation path access, and logical operators. Designed for simple JSON file persistence without a full database. Note: The package has only one version (1.0.0) and appears to be in an early stage, with minimal community adoption and infrequent updates.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/carlosgalveias/json-orm","tags":["javascript","node","json","orm","database","nosql","security","secure"],"install":[{"cmd":"npm install json-orm","lang":"bash","label":"npm"},{"cmd":"yarn add json-orm","lang":"bash","label":"yarn"},{"cmd":"pnpm add json-orm","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Package does not provide ESM exports; only CommonJS is supported.","wrong":"import JSONORM from 'json-orm';","symbol":"JSONORM","correct":"const JSONORM = require('json-orm');"},{"note":"In TypeScript with esModuleInterop, you can also do `import JSONORM from 'json-orm'`.","wrong":null,"symbol":"JSONORM","correct":"import JSONORM = require('json-orm');"},{"note":"Query must be an object with 'keyName' and 'value' properties, not positional arguments.","wrong":"db.findSync('role', 'admin')","symbol":"findSync","correct":"db.findSync({ keyName: 'role', value: 'admin' })"},{"note":"updates must be an array of update objects, even for a single field.","wrong":"db.updateSync('path', { keyName: 'field', value: 'new' })","symbol":"updateSync","correct":"db.updateSync('path', [{ keyName: 'field', value: 'new' }])"}],"quickstart":{"code":"const JSONORM = require('json-orm');\n\nconst data = {\n  users: [\n    { id: 1, name: 'John Doe', role: 'admin' },\n    { id: 2, name: 'Jane Smith', role: 'user' }\n  ]\n};\n\nconst db = new JSONORM(data);\n\n// Find admins synchronously\nconst admins = db.findSync({ keyName: 'role', value: 'admin' });\nconsole.log('Found admins:', admins);\n// => Found admins: ['users.0']\n\n// Get the actual object from the path\nconst adminUser = db.getObject(admins[0]);\nconsole.log('Admin user:', adminUser);\n// => Admin user: { id: 1, name: 'John Doe', role: 'admin' }\n\n// Asynchronous find\ndb.find({ keyName: 'name', value: 'Jane Smith' })\n  .then(results => console.log('Async result:', results));\n// => Async result: [ 'users.1' ]","lang":"javascript","description":"Demonstrates synchronous and asynchronous querying, path-based access, and retrieval of objects from paths."},"warnings":[{"fix":"Use the exact query format: { keyName: 'property', value: 'desiredValue' }.","message":"The `findSync` query must be an object with both `keyName` and `value`; no support for complex nested queries or nested path matching beyond direct key-value checks.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Wrap the update object in an array: `db.updateSync('path', [{ keyName: 'field', value: 'new' }])`.","message":"The `updateSync` method requires an array of update objects even for a single field; passing a single object will cause an error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"After modifying data, call `db.saveToFile('data.json')` to persist.","message":"The library does not automatically persist to disk; changes are only in memory. Use `db.saveToFile(path)` to write to disk.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Implement your own validation logic before inserting/updating data.","message":"No built-in validation or schema enforcement; data integrity is entirely the user's responsibility.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':12,75 '2023':14 'access':54 'adopt':87 'api':36 'appear':77 'asynchron':35 'communiti':86 'crud':29 'data':20 'databas':67,95 'depend':8 'design':58 'dot':51 'dot-not':50 'earli':82 'express':49 'file':62 'full':66 'infrequ':89 'interfac':27 'javascript':91 'json':2,19,61,93 'json-orm':1 'key':40 'key-valu':39 'librari':10 'lightweight':5 'like':26 'logic':56 'manipul':18 'minim':85 'node':92 'node.js':9 'nosql':96 'notat':52 'note':68 'one':73 'oper':30,57 'orm':3,25,94 'orm-lik':24 'packag':70 'pair':42 'path':53 'persist':63 'provid':28 'queri':16,37 'regular':48 'releas':13 'secur':97,98 'simpl':60 'stage':83 'structur':21 'support':44 'synchron':33 'updat':90 'use':22 'valu':41 'version':11,74 'wildcard':46 'without':64 'zero':7 'zero-depend':6","created_at":"2026-06-04T18:51:55.596854+00:00","updated_at":"2026-06-04T18:51:55.596854+00:00","problems":[{"fix":"Use require: `const JSONORM = require('json-orm');`","cause":"Using ES module import syntax with a CommonJS-only package.","error":"TypeError: JSONORM is not a constructor"},{"fix":"Ensure you instantiate the class: `const db = new JSONORM(data);` then call `db.findSync(...)`.","cause":"Attempting to call findSync on an instance before calling new JSONORM(); or using wrong import.","error":"findSync is not a function"},{"fix":"Use an object: `db.findSync({ keyName: 'role', value: 'admin' })`.","cause":"Passing a string instead of an object to findSync.","error":"Cannot read properties of undefined (reading 'keyName')"},{"fix":"Wrap the update object in square brackets: `db.updateSync('path', [{ keyName: 'field', value: 'new' }])`.","cause":"Passing a single object to updateSync instead of an array.","error":"updates must be an array"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/carlosgalveias/json-orm#readme","github":"https://github.com/carlosgalveias/json-orm","docs":null,"changelog":null,"pypi":null,"npm":"json-orm","openapi_spec":null,"status_page":null,"smithery":null,"categories":["database"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}