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

bendjs

v1.0.8

Published

Bend CLI - Production-ready backend scaffolder (Global CLI wrapper)

Readme

bendjs

npm version CI License: MIT Node.js Version Bun Version

Global CLI for Bend - Production-ready backend scaffolder with enterprise-grade security and logging.

Installation

npm install -g bendjs

Usage

# Interactive mode
bend

# With project name
bend my-backend

# Skip dependency installation
bend my-backend --no-install

What is bendjs?

bendjs is a global CLI wrapper around bend-core. It provides a convenient bend command for users who prefer global installation.

When to use bendjs?

Use bendjs if you:

  • Prefer global CLI tools
  • Want a short command (bend instead of npx bend-core)
  • Create Bend projects frequently

Use create-bend if you:

  • Prefer not installing global packages
  • Want to always use the latest version
  • Follow npm create/init conventions
# Using bendjs (global)
npm install -g bendjs
bend my-project

# Using create-bend (recommended)
npm create bend@latest my-project

Features

Every Bend project includes production-ready features:

Security

  • helmet() - Security HTTP headers (prevents XSS, clickjacking, etc.)
  • cors() - Configurable cross-origin resource sharing
  • rateLimit() - DDoS protection (100 requests per 15 minutes per IP)
  • hpp() - HTTP parameter pollution prevention
  • compression() - Response compression
  • Body limits - Prevents memory exhaustion (10MB default)

Logging & Monitoring

  • Winston - Enterprise-grade structured logging
  • Daily rotation - Automatic log archival (30-day retention)
  • Separate logs - error.log, combined.log, exceptions.log
  • HTTP logging - Morgan middleware integration
  • JSON format - Compatible with DataDog, Splunk, ELK, CloudWatch

Error Handling

  • Async error handling - express-async-errors (no try/catch needed)
  • Centralized middleware - Single error handler
  • Graceful shutdown - Proper cleanup on SIGTERM/SIGINT
  • Unhandled rejections - No silent crashes

Stack Options

Choose from 8 production-tested combinations:

  • Runtimes: Node.js or Bun (auto-detected)
  • Languages: TypeScript or JavaScript
  • Frameworks: Express or Fastify
  • ORMs: Mongoose (MongoDB) or Prisma (SQL)

Commands

# Create new project
bend my-backend

# Skip installation
bend my-backend --no-install

# Help
bend --help

# Version
bend --version

Generated Project Structure

my-backend/
├── src/
│   ├── config/
│   │   ├── database.ts      # Database connection with retry
│   │   └── logger.ts        # Winston + daily rotation
│   ├── controllers/         # Route controllers
│   ├── models/              # Database models
│   │   └── User.model.ts    # Example user model
│   ├── routes/              # API routes
│   │   └── health.routes.ts
│   ├── services/            # Business logic
│   ├── middlewares/         # Custom middlewares
│   ├── utils/               # Utility functions
│   ├── app.ts               # App + security setup
│   └── server.ts            # Entry point + graceful shutdown
├── logs/                    # Auto-generated logs
├── .env                     # Environment variables
├── .gitignore
├── package.json
├── tsconfig.json            # (TypeScript projects)
└── README.md

Example Output

// app.ts - Security already configured!

import helmet from 'helmet';
import cors from 'cors';
import rateLimit from 'express-rate-limit';
import hpp from 'hpp';
import compression from 'compression';
import logger from './config/logger';

const app = express();

// Security middlewares
app.use(helmet());
app.use(cors({ origin: process.env.CORS_ORIGIN || '*' }));
app.use(hpp());

// Rate limiting (DDoS protection)
const limiter = rateLimit({
  windowMs: 15 * 60 * 1000, // 15 minutes
  max: 100,                  // 100 requests per IP
});
app.use('/api/', limiter);

// Compression
app.use(compression());

// HTTP request logging
app.use(morgan('combined', {
  stream: { write: (msg) => logger.info(msg.trim()) }
}));

Package Ecosystem

Bend provides three packages:

1. create-bend (Recommended for most users)

npm create bend@latest

Advantages:

  • No installation needed
  • Always uses latest version
  • Standard npm create pattern

2. bend-core (For direct usage)

npx bend-core

Advantages:

  • Direct access to core library
  • Can be used programmatically
  • No global installation

3. bendjs (This package - for global CLI)

npm install -g bendjs
bend

Advantages:

  • Short command (bend)
  • Installed once, use anywhere
  • Traditional CLI feel

Environment Variables

Configure your generated project:

# Server
PORT=3000
NODE_ENV=development

# Database (MongoDB)
MONGODB_URI=mongodb://localhost:27017/myapp

# Database (Prisma - PostgreSQL)
DATABASE_URL="postgresql://user:password@localhost:5432/mydb"

# Security
CORS_ORIGIN=https://yourdomain.com

# Logging
LOG_LEVEL=info  # error | warn | info | debug

Development Workflow

After generating a project:

# Install dependencies (if skipped)
npm install

# Development mode (auto-reload)
npm run dev

# Production mode
npm start

# Build (TypeScript only)
npm run build

# Linting
npm run lint
npm run lint:fix

# Formatting
npm run format

Updating

# Update to latest version
npm update -g bendjs

# Check current version
bend --version

Uninstalling

npm uninstall -g bendjs

Why Global CLI?

Some developers prefer global CLIs because:

  • Shorter commands: bend vs npm create bend
  • Faster execution: No download on each run
  • Familiar pattern: Like create-react-app, vue create, etc.
  • Offline usage: Works without internet (after installation)

Links

  • Main Project: https://github.com/bendhq/bend
  • npm (bendjs): https://www.npmjs.com/package/bendjs
  • npm (bend-core): https://www.npmjs.com/package/bend-core
  • npm (create-bend): https://www.npmjs.com/package/create-bend
  • Website: https://bendhq.org
  • Documentation: https://bendhq.org/docs
  • Issues: https://github.com/bendhq/bend/issues

License

MIT © Bend


Part of Bend - Production-ready backends in seconds.