npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@romatech/orm-cli

v2.0.0

Published

CLI for RomaTech ORM – migrations, scaffold and more

Readme

@romatech/orm-cli

Command-line interface for @romatech/orm.

Manage migrations and scaffold entities directly from your terminal.


Installation

Global (recommended)

npm install -g @romatech/orm-cli

Local (project-level)

npm install --save-dev @romatech/orm-cli
npx orm --help

Configuration

Create an orm.config.js (or orm.config.mjs) at your project root:

// orm.config.js
import { MsSqlProvider } from '@romatech/orm-providers-mssql';

export default {
    // Required — the database provider instance
    provider: new MsSqlProvider({
        server: 'localhost',
        database: 'MyDb',
        user: 'sa',
        password: 'yourPassword',
        options: { trustServerCertificate: true }
    }),

    // Optional — override the connection string (takes precedence over config object)
    connectionString: '',

    // Optional — directory where migration JSON files are stored
    migrationsPath: './migrations',

    // Optional — output directory for scaffolded entity files
    outputDir: 'src/entities',

    // Optional — output directory for the scaffolded DbContext
    contextDir: 'src/context',

    // Optional — class name for the scaffolded DbContext
    contextName: 'AppDbContext',

    // Optional — entity module paths to pre-load (so decorators register metadata)
    entities: ['./dist/entities/*.js']
};

Tip: The CLI uses ESM dynamic imports, so you can use any provider package.


Commands

orm migration:create <name>

Generates a new migration JSON file based on the current entity metadata.

orm migration:create InitialCreate
orm migration:create AddProductsTable
orm migration:create -c path/to/orm.config.js AddIndex

Output:

Migration '20260605120000_InitialCreate' created.

The file is written to migrationsPath (default: ./migrations/).


orm update-database

Connects to the database and applies all pending migrations in chronological order.

orm update-database
orm update-database --to 20260605120000_AddUsersTable

| Option | Description | |--------|-------------| | -t, --to <migration> | Apply up to this migration (inclusive) | | -c, --config <path> | Path to config file (default: orm.config.js) |


orm downgrade-database

Reverts the most recently applied migration, or reverts down to a specified target.

orm downgrade-database
orm downgrade-database --to 20260605120000_Initial

| Option | Description | |--------|-------------| | -t, --to <migration> | Revert everything after this migration (exclusive) | | -c, --config <path> | Path to config file |


orm scaffold

Connects to the database, reads the schema, and generates TypeScript entity files and a DbContext.

orm scaffold
orm scaffold -c path/to/orm.config.js

| Option | Description | |--------|-------------| | -c, --config <path> | Path to config file |

Generated files:

src/entities/User.ts
src/entities/Product.ts
src/entities/Order.ts
src/context/AppDbContext.ts

Each entity file includes @Entity, @PrimaryKey, and @Column decorators auto-detected from the database column metadata.


Workflow Example

# 1. Build your TypeScript project so entities are compiled
npm run build

# 2. Create a migration from the current entity state
orm migration:create InitialCreate

# 3. Apply the migration to the database
orm update-database

# 4. Later, add a new entity and create another migration
orm migration:create AddOrdersTable
orm update-database

# 5. Oops, revert the last migration
orm downgrade-database

Config File Resolution

The CLI looks for the config file in this order:

  1. Explicit path via --config / -c flag
  2. orm.config.js in the current working directory

The config file must export (default or named) an object with at minimum a provider property.


Requirements

  • Node.js >= 18
  • A provider package matching your database
  • A compiled orm.config.js (ESM/CJS) at your project root

License

MIT © RomaTech / Leandro Romanelli