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

@gzl10/nexus-backend

v0.12.7

Published

Backend as a Service (BaaS) with Express 5, Knex and CASL

Readme

@gzl10/nexus-backend

npm version npm downloads License: MIT

Warning: This project is in experimental phase. Use at your own risk.

Backend as a Service (BaaS) with Express 5, Knex, and CASL. Build modular, type-safe backends with authentication, authorization, and real-time features.

Repository: gitlab.gzl10.com/oss/nexus

Installation

pnpm add @gzl10/nexus-backend

Quick Start

import { start } from '@gzl10/nexus-backend'

await start({
  port: 3000,
  database: { url: 'file:./data/nexus.db' }
})

Features

Core Modules

| Module | Description | | ------ | ----------- | | auth | JWT authentication with access/refresh tokens, OTP challenge, password reset | | users | User management with multi-role support | | storage | File storage (local/S3), thumbnails, deduplication | | mail | Email sending via SMTP (Nodemailer) | | notifications | In-app notification system | | schedules | Scheduled tasks (cron jobs) | | compliance | GDPR consent tracking, legal documents | | tags | Tagging system for any entity | | links | Entity relationships and linking |

Platform Features

| Feature | Description | | ------- | ----------- | | Express 5 | Modern async error handling | | Multi-DB | SQLite, PostgreSQL, MySQL via Knex | | CASL | Attribute-based access control with multi-role | | Socket.IO | Real-time events and notifications | | Plugin Architecture | Extend with custom modules and plugins | | OpenAPI | Auto-generated API documentation | | Rate Limiting | Built-in rate limiting middleware |

Configuration

import { start } from '@gzl10/nexus-backend'

await start({
  port: 3000,
  host: '0.0.0.0',

  // Frontend SPA
  ui: {
    enabled: true,
    base: '/',
    path: '../ui/dist'
  },

  // Custom routes
  beforeRoutes: (app) => {
    app.get('/api/health_custom', (_req, res) => res.json({ ok: true }))
  },
  afterRoutes: (app, serveSPA) => {
    serveSPA('/admin', '../admin/dist')
  },

  // Event subscriptions
  events: {
    'auth.login': ({ userId }) => console.log('Login:', userId),
    'db.users.created': ({ data }) => console.log('New user:', data.email)
  },

  // Custom CASL rules
  casl: (user, { can }) => {
    if (user.email.endsWith('@admin.com')) can('manage', 'all')
  },

  // Lifecycle hooks
  onReady: (app, port, host) => console.log(`Ready at ${host}:${port}`),
  beforeClose: () => console.log('Shutting down...')
})

Config Options

| Option | Type | Default | Description | | ------ | ---- | ------- | ----------- | | port | number | 3000 | Server port | | host | string | 0.0.0.0 | Server host | | ui.enabled | boolean | true | Serve frontend SPA | | ui.base | string | / | Base path for UI | | ui.path | string | ../ui/dist | Path to frontend dist | | database.url | string | - | Database connection URL | | plugins | PluginManifest[] | - | Plugins to register | | modules | ModuleManifest[] | - | Standalone modules | | beforeRoutes | function | - | Hook before module routes | | afterRoutes | function | - | Hook after module routes | | events | object | - | Event subscriptions | | casl | function | - | Custom CASL rules | | onReady | function | - | Server ready callback | | beforeClose | function | - | Pre-shutdown callback |

Environment Variables

AUTH_SECRET=your-secret-key-min-32-chars  # Required (min 32 chars)
DATABASE_URL=file:./data/nexus.db         # SQLite, PostgreSQL, or MySQL

See .env.example for full list of options.

Extending with Plugins

import { start } from '@gzl10/nexus-backend'
import { cmsPlugin } from '@gzl10/nexus-plugin-cms'
import { myCustomModule } from './my-module'

await start({
  plugins: [cmsPlugin],
  modules: [myCustomModule]
})

Exported Functions

| Function | Description | | -------- | ----------- | | start(config?) | Start the server | | stop() | Stop the server | | restart(config?) | Restart with new config | | db | Knex database instance | | nexusEvents | Event emitter for system events | | defineAbilityFor(user, permissions) | Create CASL abilities | | getCoreModules() | Get core modules list | | getUserModules() | Get user modules list |

CLI

npx nexus start    # Start server
npx nexus migrate  # Run migrations
npx nexus seed     # Seed database

Development

pnpm dev           # Start dev server
pnpm build         # Build for production
pnpm typecheck     # Type check
pnpm test          # Run tests

Stack

Express 5 | Knex | CASL | JWT | Socket.IO | Zod | Pino

License

MIT