h-orm is a lightweight MySQL ORM for Node.js, version 0.0.11. It provides a simple promise-based API for common CRUD operations, connection pooling, and a model-based approach. Key differentiators include minimal configuration, support for like queries, and automatic status field handling for soft deletes. The package has a low release cadence and is suitable for small to medium projects.
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.
h-orm is CJS-only; use require().
const horm = require('h-orm');
model() is a method on the default export, not a named export.
const horm = require('h-orm'); const Model = horm.model('table', schema);
connect() is a method on the default export, called directly.
const horm = require('h-orm'); horm.connect(config);
Shows connection setup, model definition, and CRUD operations: find, create, update, delete.
const horm = require('h-orm');
horm.connect({
host: process.env.DB_HOST || '127.0.0.1',
port: process.env.DB_PORT || '3306',
database: process.env.DB_NAME || 'test',
user: process.env.DB_USER || 'root',
password: process.env.DB_PASS || '',
debug: true
});
const UserModel = horm.model('users', {
name: String,
age: Number
});
(async () => {
const all = await UserModel();
console.log('All users:', all);
const created = await UserModel().create({ name: 'Alice', age: 30 });
console.log('Created:', created);
const found = await UserModel().find(1);
console.log('Found by id 1:', found);
const updated = await UserModel().update({ age: 31 }, { name: 'Alice' });
console.log('Updated:', updated);
const deleted = await UserModel().delete({ age: 31 });
console.log('Deleted count:', deleted);
})();
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.