JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 5
  • Score
    100M100P100Q34478F
  • License MIT

CLI tool for generating CRUD backend files in Nuxt 3 projects

Package Exports

  • nuxt-crud-cli
  • nuxt-crud-cli/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (nuxt-crud-cli) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Nuxt CRUD CLI

A Laravel Artisan-inspired CLI tool for generating CRUD backend files in Nuxt 3 projects with Drizzle ORM and SQLite.

Installation

npm install -g nuxt-crud-cli

Usage

Generate a Model

Create a new Drizzle schema file:

# Basic model
nuxt-crud make:model User

# Model with fields
nuxt-crud make:model User -- --fields="name:string,email:string|unique,age:number"

Field types supported:

  • string, text - Text fields
  • number, int, integer - Integer fields
  • float, real - Float fields
  • boolean, bool - Boolean fields (stored as integer in SQLite)
  • date, datetime, timestamp - Date fields (stored as ISO strings)
  • json - JSON fields

Field modifiers:

  • |required - Makes field required
  • |unique - Makes field unique

This generates:

  • server/api/v1/{resource}/index.ts - List all items
  • server/api/v1/{resource}/[id].ts - Get single item
  • server/api/v1/{resource}/create.post.ts - Create new item
  • server/api/v1/{resource}/update.put.ts - Update existing item
  • server/api/v1/{resource}/validation/ - Validation schemas using drizzle-zod

Generated Structure

server/
├── api/v1/{resource}/
│   ├── index.ts              # GET /api/v1/{resource}
│   ├── [id].ts              # GET /api/v1/{resource}/{id}
│   ├── create.post.ts       # POST /api/v1/{resource}/create
│   ├── update.put.ts        # PUT /api/v1/{resource}/update/{id}
│   └── validation/
│       ├── create{Model}Schema.ts
│       ├── update{Model}Schema.ts
│       ├── {model}ResponseSchema.ts
│       └── {model}ListResponseSchema.ts
└── database/schema/
    ├── index.ts             # Schema exports
    └── {model}.ts           # Drizzle schema definition

Development

# Run CLI in development
npm run dev make:model User

# Build for production
npm run build