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

@morojs/cli

v1.3.4

Published

MoroJS Framework - Comprehensive Development Toolkit

Readme

@morojs/cli

MoroJS Framework - Comprehensive Development Toolkit

The official CLI for the MoroJS framework, providing a complete set of tools for building modern, high-performance APIs and microservices.

Features

  • Project Initialization - Create new projects with intelligent defaults
  • Advanced Module Generation - Create modules with built-in middleware and features
  • Configuration Management - Generate and validate MoroJS configurations
  • Database Management - Setup adapters, run migrations, and seed data
  • Multi-Runtime Deployment - Deploy to Vercel, AWS Lambda, Cloudflare Workers
  • Middleware Management - Add and configure built-in middleware
  • Development Tools - Dev server, build, lint, test commands
  • Security Scanning - Built-in security analysis tools

Quick Start

# Install globally
npm install -g @morojs/cli

# Create a new project
morojs-cli init my-api --runtime=node --database=postgresql --features=auth,cors,docs --validation=zod

# Navigate to project
cd my-api

# Start development server
npm run dev

Commands

Project Management

# Initialize new project
morojs-cli init <project-name> [options]
  -r, --runtime <type>      Runtime adapter (node|vercel-edge|aws-lambda|cloudflare-workers)
  -d, --database <type>     Database adapter (mysql|postgresql|sqlite|mongodb|redis|drizzle)
  -f, --features <list>     Features (auth,cors,helmet,compression,websocket,docs)
  -w, --websocket <adapter> WebSocket adapter (auto-detect|socket.io|ws|none)
  -v, --validation <lib>    Validation library (zod|joi|yup|class-validator|multiple)
  -t, --template <type>     Template (api|fullstack|microservice)
  --skip-git               Skip Git initialization
  --skip-install           Skip npm install

Module Development

# Create advanced module
morojs-cli module create <name> [options]
  -f, --features <list>     Features (websocket,database,auth,cache,validation,docs)
  -d, --database <type>     Database adapter type
  -m, --middleware <list>   Built-in middleware (auth,cors,rate-limit,cache,validation)
  -r, --routes <pattern>    Route patterns (crud,rest,graphql)
  --auth-roles <roles>      Authentication roles
  --with-tests             Generate test files
  --with-docs              Generate API documentation

# List modules
morojs-cli module list

# Legacy module generation
morojs-cli generate <name> --features=websocket,database

Configuration

# Generate configuration
morojs-cli config init [options]
  -e, --environment <env>   Environment (development|staging|production)
  -d, --database <type>     Primary database type
  -r, --runtime <type>      Runtime adapter type

# Validate configuration
morojs-cli config validate

# Generate .env template
morojs-cli config env --environment=production

Database Management

# Setup database adapter
morojs-cli db setup <type> [options]
  -h, --host <host>         Database host
  -p, --port <port>         Database port
  -u, --username <user>     Database username
  -d, --database <db>       Database name
  --with-migrations        Generate migration system
  --with-seeds             Generate seed system

# Run migrations
morojs-cli db migrate --up|--down|--reset

# Seed database
morojs-cli db seed --environment=development

Middleware Management

# Add middleware
morojs-cli middleware add <type> [options]
  -c, --config <json>       Middleware configuration

# List available middleware
morojs-cli middleware list

Deployment

# Vercel Edge deployment
morojs-cli deploy vercel --domain=myapi.vercel.app

# AWS Lambda deployment
morojs-cli deploy lambda --region=us-west-2 --memory=1024

# Cloudflare Workers deployment
morojs-cli deploy workers --name=my-worker

Development Tools

# Development server with hot reload
morojs-cli dev --port=3000 --watch=./modules

# Build for production
morojs-cli build --target=lambda --minify

# Code quality (linting, formatting, testing)
npm run validate            # Full validation pipeline
npm run lint               # Lint and fix issues
npm run format             # Format code with Prettier
npm run test               # Run test suite
npm run test:watch         # Run tests in watch mode
npm run test:coverage      # Generate coverage report

# Security scan
morojs-cli security:scan

Project Templates

API Server

morojs-cli init my-api --template=api --runtime=node --database=postgresql --validation=zod

Perfect for REST APIs, GraphQL servers, and backend services.

Microservice

morojs-cli init my-service --template=microservice --runtime=vercel-edge --validation=yup

Lightweight services optimized for serverless deployment.

Real-time Application

morojs-cli init my-chat --features=websocket,auth --websocket=socket.io --validation=joi

Real-time applications with WebSocket support and flexible validation.

Full-stack

morojs-cli init my-app --template=fullstack --features=auth,websocket,docs --validation=multiple

Complete application with frontend integration support and all validation libraries.

Runtime Adapters

| Runtime | Description | Deploy Command | | ---------------------- | -------------------------------------- | --------------------------- | | Node.js | Traditional server deployment | node dist/index.js | | Vercel Edge | Edge runtime with global distribution | morojs-cli deploy vercel | | AWS Lambda | Serverless functions with auto-scaling | morojs-cli deploy lambda | | Cloudflare Workers | Edge workers with V8 isolates | morojs-cli deploy workers |

Database Support

  • PostgreSQL - Full-featured relational database
  • MySQL/MariaDB - Popular relational database
  • SQLite - Lightweight embedded database
  • MongoDB - Document-oriented database
  • Redis - In-memory data structure store
  • Drizzle ORM - Type-safe database toolkit

WebSocket Support

  • Auto-detect - Automatically detects and uses available WebSocket libraries
  • Socket.IO - Feature-rich with rooms, namespaces, and real-time communication
  • Native ws - Lightweight, standards-compliant WebSocket implementation
  • None - Skip WebSocket dependencies for minimal builds

Validation Libraries

  • Zod - Type-safe validation with TypeScript integration (recommended)
  • Joi - Mature validation library with extensive features
  • Yup - Simple and popular validation library
  • Class Validator - Decorator-based validation for TypeScript classes
  • Multiple - Install all libraries for maximum flexibility

Built-in Middleware

  • Authentication - JWT, Session, OAuth support
  • CORS - Cross-Origin Resource Sharing
  • Rate Limiting - Request throttling and protection
  • Caching - Response caching (Memory, Redis, File)
  • Validation - Universal validation (Zod, Joi, Yup, Class Validator)
  • Security Headers - Helmet.js integration
  • Compression - Gzip/Brotli response compression
  • Session Management - Secure session handling
  • CSRF Protection - Cross-Site Request Forgery prevention

Examples

Create a User Management API

# Initialize project with Joi validation
morojs-cli init user-api --runtime=node --database=postgresql --features=auth,docs --validation=joi

# Create users module
morojs-cli module create users --features=database,auth,cache --middleware=rate-limit --with-tests

# Setup database
morojs-cli db setup postgresql --host=localhost --database=userapi --with-migrations

# Add authentication middleware
morojs-cli middleware add auth --config='{"strategy":"jwt","expiresIn":"7d"}'

# Start development
npm run dev

Serverless Microservice

# Create lightweight service
morojs-cli init payment-service --template=microservice --runtime=aws-lambda --database=redis

# Create payment module
morojs-cli module create payments --features=validation,cache --middleware=rate-limit

# Setup deployment
morojs-cli deploy lambda --region=us-east-1 --memory=512

# Deploy
npm run deploy:lambda

Full-stack Application

# Create full-stack app with Socket.IO and multiple validation libraries
morojs-cli init chat-app --template=fullstack --features=websocket,auth,docs --database=mongodb --websocket=socket.io --validation=multiple

# Create chat module
morojs-cli module create chat --features=websocket,database,auth --with-tests

# Create users module
morojs-cli module create users --features=database,auth,validation --with-tests

# Start development
npm run dev

Configuration

MoroJS CLI respects configuration from multiple sources:

  1. Command line arguments (highest priority)
  2. Environment variables (MORO_* prefix)
  3. moro.config.ts configuration file
  4. package.json morojs field
  5. Default values (lowest priority)

Environment Variables

# Logging
LOG_LEVEL=debug
MORO_LOG_LEVEL=info

# Development
MORO_DEV_PORT=3000
MORO_DEV_HOST=localhost

# Database
DATABASE_URL=postgresql://user:pass@localhost:5432/db
REDIS_URL=redis://localhost:6379

# Security
JWT_SECRET=your-secret-key
CORS_ORIGIN=https://yourdomain.com

Development & Testing

Generated projects include a complete development workflow:

Available Scripts

# Development
npm run dev                 # Start development server
npm run build              # Build for production

# Code Quality
npm run validate           # Run all quality checks
npm run lint               # ESLint with auto-fix
npm run lint:check         # ESLint check only
npm run format             # Prettier formatting
npm run format:check       # Check formatting
npm run typecheck          # TypeScript compilation check

# Testing
npm run test               # Run all tests
npm run test:unit          # Unit tests only
npm run test:integration   # Integration tests only
npm run test:watch         # Watch mode
npm run test:coverage      # Coverage report

Quality Standards

All generated projects include:

  • TypeScript for type safety
  • ESLint for code quality
  • Prettier for consistent formatting
  • Jest for testing with TypeScript support
  • GitHub Actions for CI/CD

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

Links


Built with ❤️ by the MoroJS Team