Registry / database / ledom
library1.1.6jsnpmunverified

Node.js MySQL model library providing a simple ORM-like interface for defining models and interacting with MySQL databases. The current version is 1.1.6, released in 2015 with no recent updates, indicating it is in maintenance mode. It offers basic model definition and CRUD operations but lacks many features such as join support, validation, and virtual fields. Compared to more modern alternatives like Sequelize or TypeORM, ledom is minimal and suitable for legacy projects. It requires Node >= 0.10.0 and has no runtime dependencies.

npm install ledom
INSTALL
IMPORT
SIG · LEDOM
L
ledom
databasejavascriptv1.1.6
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default export
import ledom from 'ledom';
const ledom = require('ledom'); // CommonJS works but not recommended for ESM
Package does not ship TypeScript definitions; use @types/ledom if available.
defineModel
import { defineModel } from 'ledom';
const defineModel = require('ledom').defineModel;
Named export available for the model definition function.
Model
import { Model } from 'ledom';
const Model = require('ledom').Model;
Model class for extending, but usage via defineModel is more typical.

Defines a User model with ledom, creates a record, and queries adults.

import { defineModel } from 'ledom'; import mysql from 'mysql2/promise'; async function main() { const connection = await mysql.createConnection({ host: 'localhost', user: 'root', password: process.env.DB_PASSWORD ?? '', database: 'test' }); const User = defineModel('User', connection, { name: { type: 'string', length: 255 }, email: { type: 'string', length: 255 }, age: { type: 'int', default: 0 } }); const user = await User.create({ name: 'Alice', email: 'alice@example.com' }); console.log('Created:', user); const users = await User.find({ age: { '>=': 18 } }); console.log('Users:', users); await connection.end(); } main().catch(console.error);
Debug
Known issues
gotchaNo support for joins or associations; you must manually handle relationships.
fix
Use raw SQL queries or migrate to an ORM that supports joins.
affects: <=1.1.6
gotchaNo input validation; invalid data may cause MySQL errors.
fix
Add validation layer before calling ledom methods.
affects: <=1.1.6
deprecatedPackage has not been updated since 2015; Node.js versions beyond 0.10.x may have compatibility issues.
fix
Test with your Node version; consider upgrading to a maintained ORM.
affects: >=1.0.0
gotchaNo support for async/await; methods return promises but with old style callbacks in some versions.
fix
Wrap in Promise or use a wrapper library.
affects: <=1.1.6
Errors
Common errors & fixes
TypeError: ledom.defineModel is not a function
Incorrect import or version mismatch; the module may not be installed correctly.
fix
Ensure you are using a compatible import: const ledom = require('ledom'); then ledom.defineModel(...).
Error: Cannot find module 'ledom'
Package not installed or missing from node_modules.
fix
Run 'npm install ledom' or check your package.json.
ReferenceError: defineModel is not defined
Using ES module named import incorrectly in a CommonJS environment.
fix
Use 'const { defineModel } = require('ledom');' instead of import syntax.
Upgrade
Version history
1.1.6latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
25 hits · last 30 days
node
24
Resources
packageledom
ledom — npm install ledom · libregistry