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 🙏

© 2025 – Pkg Stats / Ryan Hefner

crud-cli-auto

v1.0.8

Published

Uma Cli para gerar um CRUD completo (Model, Controller, Service, Routes) a partir de um modelo do Prisma.

Readme

CRUD CLI CLI para gerar automaticamente arquivos de CRUD (Create, Read, Update, Delete) a partir de um schema Prisma. 🚀 Instalação Instalação global npm install -g crud-cli-auto 📋 Pré-requisitos • Node.js 16+ • Projeto com Prisma configurado • Schema Prisma válido 🎯 Uso Gerar CRUD

Gerar a partir do schema padrão (./prisma/schema.prisma)

crud-cli generate

Especificar caminho do schema

crud-cli generate -p ./meu-schema.prisma

Especificar pasta de saída

crud-cli generate -o ./src

Forçar sobrescrita sem confirmação

crud-cli generate --force Atualizar CRUD existente

Atualizar arquivos existentes

crud-cli update

Criar backup antes de atualizar

crud-cli update --backup

Especificar caminhos

crud-cli update -p ./prisma/schema.prisma -o ./src Ajuda crud-cli --help crud-cli generate --help crud-cli update --help 📁 Estrutura gerada Para cada modelo no schema, serão criados: src/ ├── services/ │ ├── userService.js │ └── postService.js ├── controllers/ │ ├── userController.js │ └── postController.js └── routes/ ├── userRoutes.js ├── postRoutes.js └── index.js 📝 Exemplo de schema model User { id Int @id @default(autoincrement()) name String email String @unique posts Post[] }

model Post { id Int @id @default(autoincrement()) title String content String? userId Int user User @relation(fields: [userId], references: [id]) } 🔧 Funcionalidades geradas Services • getAll(options) - Listagem com paginação • getById(id) - Buscar por ID • create(data) - Criar novo registro • update(id, data) - Atualizar registro • delete(id) - Deletar registro • search(query, options) - Busca textual Controllers • Tratamento de erros com chalk colorido • Validação de dados • Responses padronizadas • Logs informativos Routes • Rotas RESTful completas • Documentação inline • Middleware-ready • Health check endpoint 📊 Exemplos de uso das APIs geradas Listar usuários GET /users?page=1&limit=10&orderBy=name&order=asc Buscar usuário GET /users/1 Criar usuário POST /users { "name": "João Silva", "email": "[email protected]" } Buscar usuários GET /users/search?q=joão&page=1&limit=5 ⚙️ Opções de configuração Paginação • page: Página atual (padrão: 1) • limit: Items por página (padrão: 10) • orderBy: Campo para ordenação (padrão: id) • order: Direção da ordenação (asc/desc, padrão: asc) Validação automática • Campos obrigatórios são validados • Tipos de dados são verificados • Constraints únicos são respeitados 📄 Schema de exemplo Crie um arquivo examples/schema.prisma: generator client { provider = "prisma-client-js" }

datasource db { provider = "postgresql" url = env("DATABASE_URL") }

model User { id Int @id @default(autoincrement()) name String email String @unique createdAt DateTime @default(now()) updatedAt DateTime @updatedAt posts Post[] }

model Post { id Int @id @default(autoincrement()) title String content String? published Boolean @default(false) userId Int user User @relation(fields: [userId], references: [id]) createdAt DateTime @default(now()) updatedAt DateTime @updatedAt } 🐛 Solução de problemas Erro: Schema não encontrado

Verifique o caminho do schema

ls -la ./prisma/schema.prisma

Use caminho absoluto

crud-cli generate -p /caminho/completo/schema.prisma Erro: Permissões

Executar com sudo (Linux/Mac)

sudo npm install -g crud-cli

Verificar permissões da pasta

ls -la ./src/ 📈 Roadmap • ✅ Geração básica de CRUD • ✅ Atualização de arquivos • ✅ Paginação automática • ✅ Busca textual • ⏳ Templates customizáveis • ⏳ Integração com Swagger • ⏳ Geração de testes • ⏳ Suporte a middleware personalizado 🤝 Contribuição

  1. Fork o projeto
  2. Crie uma branch: git checkout -b feature/nova-feature
  3. Commit: git commit -m 'Adicionar nova feature'
  4. Push: git push origin feature/nova-feature
  5. Pull Request 📜 Licença MIT License - veja LICENSE para detalhes.