Registry / database / junction-orm

junction-orm

JSON →
library0.4.0jsnpmunverified

A JavaScript ORM that keeps domain models free from persistence logic, using plain objects (POJOs) for models. Version 0.4.0 targets Node.js 6+. It differentiates by not requiring model classes to extend or embed ORM-specific code, instead mapping plain objects to database tables via configuration.

database
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 import is ESM-style; CJS require may not work in all Node versions.

import junction from 'junction-orm'

Named export for model definition.

import { define } from 'junction-orm'

Used to establish database connection.

import { connect } from 'junction-orm'

Shows how to define a model, connect to SQLite, sync schema, and create a record.

import { define, connect } from 'junction-orm'; const User = define('User', { name: String, email: { type: String, unique: true } }); async function run() { const db = await connect({ dialect: 'sqlite', storage: ':memory:' }); await db.sync(); const user = await User.create({ name: 'Alice', email: 'alice@example.com' }); console.log(user.id, user.name); } run();
Debug
Known footguns
gotchaModel definitions must provide type for each field (e.g., String, Number).
gotchaDatabase connection is asynchronous and must be awaited.
gotchasync() must be called after connect to create tables.
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.

Agent activity
10 hits · last 30 days
gptbot
3
mj12bot
1
ahrefsbot
1
Resources