Registry / database / esme
library0.3.5jsnpmunverified

Esme is a TypeScript-first schema migration library for PostgreSQL that provides an abstract interface for managing database schema changes. Current stable version is 0.3.5, with irregular release cadence. It differentiates from tools like Knex or TypeORM by focusing on a minimal, type-safe API using bus-style actions (addTable, addColumn, relationships) and offering an abstract class to implement custom migration backends. Requires pg v7 as a peer dependency.

npm install esme
INSTALL
IMPORT
SIG · ESME
E
esme
databasejavascriptv0.3.5
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.

Esme
import { Esme } from 'esme'
Default export is not available; use named import.
Esme
const Esme = require('esme').Esme
Esme ships TypeScript types and is ESM-first. Use import statement.
type EsmeConfig
import type { EsmeConfig } from 'esme'
Type imports are supported and recommended for type-only usage.

Shows how to extend the Esme abstract class and implement all required migration methods.

import { Esme } from 'esme'; class MyMigration extends Esme { async addTable(action) { // implement return true; } async dropTable(action) { // implement return true; } async addColumn(action) { // implement return true; } async oneToOne(action, schema) { // implement return true; } async oneToMany(action, schema) { // implement return true; } async manyToMany(action, schema) { // implement return true; } async commit(action) { // implement return true; } async initialize() { return true; } async getCommits() { return [{ name: 'initial', created_at: new Date() }]; } async beginTransaction() {} async commitTransaction() {} async rollbackTransaction() {} } const migrator = new MyMigration(); await migrator.initialize();
Debug
Known issues
gotchaPackage version 0.x: API is unstable and may change without notice. All migration methods must be implemented in subclasses.
fix
Pin to exact version and test thoroughly before upgrading.
affects: >=0.0.0 <1.0.0
breakingRequires pg v7 as peer dependency; incompatible with pg v8+.
fix
Use pg version 7.x explicitly in your project.
affects: >=0.0.0
gotchaAbstract class Esme must be implemented; direct instantiation will throw a runtime error.
fix
Create a subclass that implements all abstract methods.
affects: >=0.0.0
Errors
Common errors & fixes
Cannot find module 'esme'
Package not installed or missing from node_modules.
fix
Install esme: npm install esme
TypeError: esme_1.Esme is not a constructor
Using default import instead of named import.
fix
Use import { Esme } from 'esme'.
Module not found: Can't resolve 'pg'
Missing peer dependency 'pg'.
fix
Install pg: npm install pg@7
Upgrade
Version history
0.3.5latest on npm
Audit
Dependencies
pgrequiredRequired as peer dependency for PostgreSQL database access
Agent activity
10 hits · last 30 days
node
8
Resources
packageesme
esme — npm install esme · libregistry