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

faster-crud

v1.3.0

Published

A dynamic CRUD library for Mongoose with CLI support, validation, and Swagger integration

Downloads

7

Readme

faster-crud

Introducción

faster-crud es una librería dinámica para operaciones CRUD basada en Mongoose. Diseñada para desarrolladores de Node.js, esta herramienta incluye soporte para CLI, validación avanzada, y documentación automática con Swagger. Es ideal para crear rápidamente aplicaciones escalables con MongoDB.

Características Principales

  • CRUD dinámico: Soporte para operaciones CRUD automáticas.
  • CLI: Herramienta de línea de comandos para generar modelos y configuraciones.
  • Validación avanzada: Uso de joi para asegurar datos robustos.
  • Integración con Swagger: Documentación interactiva disponible en /api-docs.
  • Middleware:
    • Sanitización de entradas: Protege contra inyecciones.
    • Helmet: Mejora la seguridad HTTP.
    • Rate limiting: Previene abusos en las solicitudes.
  • Paginación: Soporte para listar datos de manera eficiente.

Requisitos Previos

  • Node.js: v16.0.0 o superior.
  • MongoDB: Configurado y accesible.

Dependencias

  • mongoose: Conexión y manipulación de datos en MongoDB.
  • joi: Validación de esquemas.
  • swagger-ui-express: Generación de documentación API.
  • express: Framework HTTP.

Guía de Instalación

Instalación de la librería

Ejecute el siguiente comando:

npm install faster-crud

Configuración inicial

Cree un archivo .env para configurar las variables de entorno:

MONGO_URI=su_conexion_mongo
PORT=3000

Uso Básico

Importar y configurar la librería

import fasterCrud from "faster-crud";

// Inicializar la librería
fasterCrud.initialize({
  mongooseURI: process.env.MONGO_URI,
  swagger: true,
});

CLI

Ejecute el CLI con el siguiente comando:

npx faster-crud

Documentación Completa de APIs

Endpoints principales

/api/users

  • GET: Obtiene todos los usuarios.
  • POST: Crea un nuevo usuario.
    • Parámetros (en el cuerpo):
      {
        "name": "John Doe",
        "email": "[email protected]",
        "password": "securepassword"
      }

Casos de Uso

  1. Aplicaciones con MongoDB: Crear APIs rápidas y escalables.
  2. Proyectos de prototipo: Generar CRUDs dinámicos con poca configuración.
  3. Sistemas con seguridad avanzada: Uso de middlewares preconfigurados.

Pruebas y Validaciones

Ejecutar pruebas

La librería incluye pruebas unitarias:

npm test

Contribución

Para colaborar:

  1. Haz un fork del repositorio: GitHub.
  2. Crea una rama para tus cambios:
    git checkout -b feature/nueva-funcionalidad
  3. Envía un pull request detallando los cambios.

Licencia

Este proyecto está bajo la licencia MIT. Puedes usarlo libremente para fines personales o comerciales.

Notas Adicionales

  • Para documentación interactiva, visita /api-docs en tu servidor local.
  • Personaliza los esquemas de datos en crud.config.js.