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

@nodude/code

v1.0.3

Published

Production-ready Node.js backend automation framework. Reduce backend code by 80-100%.

Readme

nodude

Reduce Node.js backend code by 80–100%. Define models, routes, and services. Everything else is automatic.

Install

npm install @nodude/code

Quickstart

import { createApp } from "@nodude/code";

const app = await createApp({
  database: { type: "mongodb", uri: process.env.MONGO_URI },
  auth: { secret: process.env.JWT_SECRET },
  models: [
    {
      name: "User",
      schema: {
        name: { type: "String", required: true },
        email: { type: "String", required: true, unique: true },
        password: { type: "String", required: true, private: true },
        role: { type: "String", default: "user", enum: ["user", "admin"] },
      },
      auth: true,
    },
    {
      name: "Product",
      schema: {
        title: { type: "String", required: true },
        price: { type: "Number", required: true },
        stock: { type: "Number", default: 0 },
      },
      roles: {
        create: ["admin"],
        update: ["admin"],
        delete: ["admin"],
        read: ["*"],
      },
    },
  ],
});

app.listen(3000, () => console.log("API running on :3000"));

That 20 lines of code generates:

  • POST /api/v1/auth/register
  • POST /api/v1/auth/login
  • GET /api/v1/users (admin)
  • GET /api/v1/users/:id
  • PUT /api/v1/users/:id
  • DELETE /api/v1/users/:id
  • GET /api/v1/products
  • GET /api/v1/products/:id
  • POST /api/v1/products (admin)
  • PUT /api/v1/products/:id (admin)
  • DELETE /api/v1/products/:id (admin)
  • GET /health

Configuration

const app = await createApp({
  port: 3000,
  apiPrefix: '/api/v1',
  database: {
    type: 'mongodb' | 'postgresql' | 'sqlite',
    uri: 'mongodb://...',
    // or for pg: { host, port, user, password, database }
    // or for sqlite: { filename: './data.db' }
  },
  auth: {
    secret: 'your-jwt-secret',
    expiresIn: '7d',
    refreshEnabled: true,
    refreshExpiresIn: '30d'
  },
  rateLimit: {
    windowMs: 15 * 60 * 1000,
    max: 100
  },
  cors: { origin: '*' },
  logging: { level: 'info', format: 'json' },
  models: [...],
  plugins: [...]
});

Model Schema Definition

{
  name: 'Post',
  schema: {
    title:   { type: 'String',  required: true, minLength: 3, maxLength: 100 },
    body:    { type: 'String',  required: true },
    author:  { type: 'ObjectId', ref: 'User' },
    tags:    { type: '[String]' },
    status:  { type: 'String', enum: ['draft','published'], default: 'draft' },
    views:   { type: 'Number', default: 0, private: false },
    secret:  { type: 'String', private: true }  // excluded from responses
  },
  timestamps: true,
  roles: {
    create: ['user', 'admin'],
    read:   ['*'],
    update: ['owner', 'admin'],
    delete: ['owner', 'admin']
  },
  hooks: {
    beforeCreate: async (data, req) => { /* mutate data */ },
    afterCreate:  async (doc, req)  => { /* side effects */ }
  }
}

Custom Services

import { createApp, defineService } from '@nodude/code';

const emailService = defineService('email', {
  async sendWelcome(user) { /* ... */ }
});

const app = await createApp({
  models: [...],
  services: [emailService],
  hooks: {
    'user.afterCreate': async (user, { services }) => {
      await services.email.sendWelcome(user);
    }
  }
});

Custom Routes

const app = await createApp({
  models: [...],
  routes: [
    {
      method: 'GET',
      path: '/api/v1/stats',
      roles: ['admin'],
      handler: async (req, res) => {
        res.json({ users: await req.db.count('User') });
      }
    }
  ]
});

Plugins

import { createPlugin } from "@nodude/code";

const auditPlugin = createPlugin("audit", {
  install(app, options) {
    app.use(async (req, res, next) => {
      req.on("finish", () => console.log(`${req.method} ${req.path}`));
      next();
    });
  },
});

CLI

npx nodude generate:model Product
npx @nodude/code generate:service payment
npx @nodude/code generate:plugin analytics
npx @nodude/code new my-api

Database Support

| Database | Adapter | Status | | ---------- | -------------- | ------ | | MongoDB | Mongoose | ✅ | | PostgreSQL | pg | ✅ | | SQLite | better-sqlite3 | ✅ |

Health Check

GET /health returns:

{
  "status": "ok",
  "uptime": 3600,
  "database": "connected",
  "timestamp": "2024-01-01T00:00:00.000Z"
}

License

MIT