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

create-lara-node

v0.3.14

Published

Scaffold a new Lara-Node application — pnpm create lara-node

Readme

create-lara-node

Interactive project scaffolder — generates a fully-configured Lara-Node application in seconds.

Usage

pnpm create lara-node
pnpm create lara-node my-api
npx create-lara-node my-api

What the CLI asks

  1. Project name — used as the directory and package.json name
  2. Database driver — MySQL or MongoDB
  3. Packages to include — multiselect from:
    • @lara-node/events — events, listeners, subscribers, broadcasting
    • @lara-node/queue — jobs and scheduler
    • @lara-node/mail — mailables
    • @lara-node/horizon — queue monitoring dashboard
    • @lara-node/telescope — debug dashboard
    • (validator, middlewares, auth, router, core, and db are always included)

Generated project structure

my-api/
├── src/
│   ├── app/
│   │   ├── Console/Commands/       # PermissionsSyncCommand, PermissionsListCommand
│   │   ├── Events/                 # UserRegistered, UserLoggedIn, UserNotification
│   │   ├── Http/
│   │   │   ├── Controllers/
│   │   │   │   ├── User/           # AuthController, UserController, RoleController, PermissionController
│   │   │   │   └── File/           # FileController (multer upload)
│   │   │   └── Kernel.ts           # Global + named middleware (auth, can, role, throttle)
│   │   ├── Jobs/
│   │   │   ├── SendMailJob.ts
│   │   │   ├── CleanupJob.ts
│   │   │   └── GenerateReportJob.ts
│   │   ├── Listeners/              # SendWelcomeEmail, LogUserLogin
│   │   ├── Mail/
│   │   │   ├── WelcomeEmail.ts
│   │   │   ├── PasswordResetEmail.ts
│   │   │   ├── AccountVerificationEmail.ts
│   │   │   └── InvoiceEmail.ts
│   │   ├── Middleware/
│   │   │   └── ThrottleMiddleware.ts
│   │   ├── Models/
│   │   │   ├── User/               # User, Role, Permission, UserProfile, RolesUsers, PermissionsRoles
│   │   │   └── File/               # File
│   │   ├── Observers/
│   │   │   └── UserObserver.ts
│   │   ├── Providers/
│   │   │   ├── AppServiceProvider.ts
│   │   │   ├── RouteServiceProvider.ts
│   │   │   ├── EventServiceProvider.ts
│   │   │   ├── BroadcastServiceProvider.ts
│   │   │   └── QueueServiceProvider.ts
│   │   ├── Services/               # AuthService, UserService, RoleService, PermissionService, FileService
│   │   └── Subscribers/            # UserEventSubscriber
│   ├── bootstrap/
│   │   └── app.ts                  # Application + provider boot
│   ├── config/                     # app.config.ts, db.config.ts
│   ├── database/
│   │   ├── migrations/             # 7 migrations (users → files)
│   │   └── seeders/                # RolePermissionSeeder, UserSeeder, DatabaseSeeder
│   ├── routes/
│   │   ├── api.ts                  # Full CRUD: auth, users, roles, permissions, files
│   │   ├── web.ts                  # Health check route
│   │   └── channels.ts             # Broadcasting channel auth
│   ├── types/
│   │   └── express.d.ts            # req.user, req.validate, res.jsonAsync type augmentations
│   ├── artisan.ts                  # CLI entry point
│   ├── register.ts                 # reflect-metadata + dotenv bootstrap
│   └── server.ts                   # HTTP server entry point
├── .env.example
├── .gitignore
├── .swcrc                          # SWC decorator metadata config
├── tsconfig.json
└── package.json

After scaffolding

cd my-api
pnpm install
cp .env.example .env
# Edit .env — set DB_HOST, DB_NAME, DB_USER, DB_PASSWORD, JWT_SECRET

pnpm artisan migrate       # create all tables
pnpm artisan db:seed       # seed admin and user accounts
pnpm dev                   # start dev server on http://localhost:3000

Or with npm:

npx create-lara-node my-api
cd my-api
npm install
cp .env.example .env

node artisan key:generate
node artisan migrate
node artisan serve

Generated API routes

| Method | Path | Auth | Description | |--------|-----------------------------------|-------------------|------------------------| | POST | /api/auth/register | — | Register | | POST | /api/auth/login | — | Login (returns JWT) | | GET | /api/auth/me | auth | Authenticated user | | GET | /api/users | view_users | List users | | POST | /api/users | create_users | Create user | | PUT | /api/users/:id | update_users | Update user | | DELETE | /api/users/:id | delete_users | Delete user | | GET | /api/roles | view_roles | List roles | | POST | /api/roles/:id/permissions | add_permissions_to_roles | Sync role permissions | | POST | /api/files | upload_files | Upload file |

Default seeded accounts

| Email | Password | Role | |------------------------|------------|-------| | [email protected] | password | Admin | | [email protected] | password | User |

Decorator overview

The scaffold uses all Lara-Node decorators. Here is a summary of what each does:

@lara-node/core

@Injectable()   // marks a class for automatic IoC constructor injection
@Provider()     // registers a ServiceProvider for app.discoverProviders()

@lara-node/router

@Bind()                     // registers a Model for route-model binding
@Middleware('alias')        // registers a middleware class under a named alias
@Route('/prefix', 'auth')   // sets base path + middleware on a controller class
@Route.get('/path')         // registers a GET route on a controller method
@Route.post / .put / .patch / .delete

@lara-node/db

@use(SoftDeletes, Timestamps)  // apply traits to a model
@Observe(ModelClass)           // auto-wires an observer to a model

@lara-node/queue

@Queueable({ queue: 'emails', tries: 3 })  // register job + set defaults

@lara-node/events

@ListensTo('user.registered')   // register as listener for auto-discovery
@ShouldQueue                    // process listener on a queue
@AfterCommit                    // dispatch only after DB transaction commits
@Subscriber                     // mark class as event subscriber

--expose-gc flag

All generated package.json scripts include --expose-gc. This lets Node release connection pool and MongoDB client memory promptly, preventing heap bloat in long-running processes.

{
  "scripts": {
    "dev":    "node --expose-gc -r @swc-node/register src/server.ts",
    "artisan": "node --expose-gc -r @swc-node/register src/artisan.ts"
  }
}

When running compiled output in production, include the flag manually:

node --expose-gc dist/server.js
node --expose-gc dist/artisan.js queue:work

Notes

  • The scaffolder itself has no required environment variables — all configuration is written into the generated project's .env.example.
  • tsconfig.json is configured with moduleResolution: "bundler" and emitDecoratorMetadata: true. Do not change the moduleResolution setting — the ORM and router decorators depend on it.
  • The scaffold uses @swc-node/register (via .swcrc) for TypeScript compilation with full decorator metadata support at runtime.