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 🙏

© 2025 – Pkg Stats / Ryan Hefner

nexusorm

v0.1.7

Published

NexusORM - A type-safe SQL ORM for Postgres and MySQL.

Readme

NexusORM 🚀

A modern, type-safe SQL ORM for PostgreSQL and MySQL — fast to adopt, powerful to scale.

npm version License Downloads GitHub stars

Buy Me a Coffee

Built with ❤️ by flenco.in


✨ Features

🔌 Zero Configuration

  • Just set DATABASE_URL and you're ready
  • Auto-detects PostgreSQL and MySQL
  • Automatic connection pooling

🛠️ Developer Experience

  • Built-in CLI for code generation
  • Complete TypeScript support
  • Auto-generated type definitions

⚡ Production Ready

  • Connection pooling & retries
  • Transaction support with savepoints
  • Comprehensive error handling

📊 Smart Features

  • Schema introspection
  • Relation mapping
  • Date/time query helpers

🚀 Quick Start

Installation

npm install nexusorm

Setup

1. Configure Environment

# .env file in your project root
DATABASE_URL="postgres://user:pass@localhost:5432/mydb"
# or
DATABASE_URL="mysql://user:pass@localhost:3306/mydb"

2. Generate Types & Models

npx nexusorm generate

3. Start Coding

import { Users, Posts } from './nexusorm/models.js';

// Ready to use - no additional setup required
const users = await Users.findMany({ limit: 10 });
const user = await Users.create({ 
  email: '[email protected]', 
  name: 'John Doe' 
});

💡 Usage Examples

CRUD Operations

import { Users } from './nexusorm/models.js';

// Create
const user = await Users.create({
  email: '[email protected]',
  name: 'John Doe',
  active: true
});

// Read with conditions
const activeUsers = await Users.findMany({
  where: { active: true },
  order: 'created_at',
  limit: 50
});

// Update
await Users.update(
  { id: user.id },
  { name: 'John Smith' }
);

// Delete
await Users.delete({ id: user.id });

Advanced Queries

import { cond } from 'nexusorm';

// Complex conditions
const recentActiveUsers = await Users.findMany({
  where: cond.and(
    cond.gt('created_at', cond.daysAgo(30)),
    cond.eq('active', true),
    cond.contains('email', '@company.com')
  ),
  order: 'created_at',
  limit: 100
});

// Date/time queries
const thisWeekUsers = await Users.findMany({
  where: cond.thisWeek('created_at')
});

Relations & Includes

// Fetch user with related posts
const userWithPosts = await Users.findFirst({
  where: { id: 1 },
  include: {
    posts: { 
      where: { published: true },
      limit: 5,
      order: 'created_at'
    }
  }
});

Transactions

import { NexusORMClient } from 'nexusorm';

const db = await NexusORMClient.initFromEnv();

await db.$transaction(async (tx) => {
  const user = await tx.model('users').create({
    email: '[email protected]',
    name: 'New User'
  });
  
  await tx.model('profiles').create({
    userId: user.id,
    bio: 'User profile'
  });
});

🛠️ CLI Commands

| Command | Description | |---------|-------------| | npx nexusorm generate | Generate types and models from database schema | | npx nexusorm db:push | Push schema changes to database | | npx nexusorm migrate:up | Run database migrations |


🔧 Configuration

Environment Variables

# Primary (required)
DATABASE_URL="postgres://user:pass@localhost:5432/db"

# Alternative formats
MYSQL_URL="mysql://user:pass@localhost:3306/db"
POSTGRES_URL="postgres://user:pass@localhost:5432/db"

Supported Databases

| Database | URL Format | Default Port | |----------|------------|--------------| | PostgreSQL | postgres://user:pass@host:port/db | 5432 | | MySQL | mysql://user:pass@host:port/db | 3306 |


📚 Documentation

📖 Local Documentation

Included with every installation

📋 Advanced Topics

📖 Complete Online Documentation


🤝 Community & Support

| 🐛 Issues | 💬 Discussions | ☕ Support | |:-------------:|:------------------:|:--------------:| | Report Bug | Join Discussion | Buy Me Coffee |


📄 License

Apache 2.0 - see LICENSE for details.


🚀 Ready to get started? Install NexusORM today!

npm install nexusorm

GitHub stars GitHub forks GitHub issues

Made with ❤️ by flenco.in