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

nova-engine

v1.0.3

Published

Todo lo q necesitas en un solo framework

Downloads

6

Readme

¡Claro! A continuación se detalla la documentación de la librería Nova, describiendo cada método y su funcionamiento.

Nova

Nova es una librería ligera para construir servidores HTTP en Node.js, similar a Express. Proporciona una API sencilla para manejar rutas, middlewares y respuestas de archivos estáticos.

Instalación

Para instalar Nova, simplemente clona el repositorio y añádelo a tu proyecto.

git clone <URL-DEL-REPOSITORIO>
cd nova
npm install

Uso Básico

const Nova = require('./path/to/nova');

const app = new Nova();

app.use((req, res, next) => {
  console.log(`${req.method} ${req.url}`);
  next();
});

app.get('/hello/:name', (req, res) => {
  res.json({ message: `Hello, ${req.params.name}!` });
});

app.listen(3000, () => {
  console.log('Server is listening on port 3000');
});

Métodos

use(middleware: RequestHandler): void

Agrega un middleware que se ejecutará en todas las solicitudes.

  • Parámetros:
    • middleware: Función que toma tres parámetros: req, res y next.

get(path: string, handler: RequestHandler): void

Define una ruta que responde a solicitudes GET.

  • Parámetros:
    • path: Ruta para la cual este manejador responderá.
    • handler: Función que toma tres parámetros: req, res y next.

post(path: string, handler: RequestHandler): void

Define una ruta que responde a solicitudes POST.

  • Parámetros:
    • path: Ruta para la cual este manejador responderá.
    • handler: Función que toma tres parámetros: req, res y next.

put(path: string, handler: RequestHandler): void

Define una ruta que responde a solicitudes PUT.

  • Parámetros:
    • path: Ruta para la cual este manejador responderá.
    • handler: Función que toma tres parámetros: req, res y next.

delete(path: string, handler: RequestHandler): void

Define una ruta que responde a solicitudes DELETE.

  • Parámetros:
    • path: Ruta para la cual este manejador responderá.
    • handler: Función que toma tres parámetros: req, res y next.

all(path: string, handler: RequestHandler): void

Define una ruta que responde a todas las solicitudes HTTP.

  • Parámetros:
    • path: Ruta para la cual este manejador responderá.
    • handler: Función que toma tres parámetros: req, res y next.

listen(port: number | string, callback?: () => void): void

Inicia el servidor en el puerto especificado.

  • Parámetros:
    • port: Número de puerto o cadena.
    • callback: Función opcional que se ejecutará cuando el servidor comience a escuchar.

Extensiones de ServerResponse

sendFile(filePath: string): void

Envía un archivo estático al cliente.

  • Parámetros:
    • filePath: Ruta del archivo a enviar.

json(data: any): void

Envía una respuesta JSON al cliente.

  • Parámetros:
    • data: Datos a enviar como JSON.

Ejemplo Completo

const Nova = require('./path/to/nova');

const app = new Nova();

app.use((req, res, next) => {
  console.log(`${req.method} ${req.url}`);
  next();
});

app.get('/hello/:name', (req, res) => {
  res.json({ message: `Hello, ${req.params.name}!` });
});

app.get('/file', (req, res) => {
  res.sendFile('path/to/your/file.txt');
});

app.listen(3000, () => {
  console.log('Server is listening on port 3000');
});

Notas

  • Nova utiliza expresiones regulares personalizadas para manejar rutas dinámicas.
  • Los middlewares son funciones que reciben tres parámetros: req, res y next.
  • Los métodos sendFile y json están disponibles en el objeto res para facilitar el envío de archivos y respuestas JSON.

Con esta documentación, deberías tener una comprensión clara de cómo usar y extender la librería Nova en tus proyectos. Si tienes alguna pregunta o necesitas más ejemplos, no dudes en consultarme.