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

@karlincoder/chronosjs

v1.0.0

Published

The ultimate date manipulation library for JavaScript

Readme

Chronos - La Ultimate Librería de Manejo de Fechas en JavaScript/TypeScript

Chronos Logo
(Nota: Este es un logo placeholder, recomendamos agregar un logo real para tu librería)

npm version License: MIT CI/CD Coverage Status Bundle Size

Chronos es la librería definitiva para el manejo de fechas en JavaScript/TypeScript. Diseñada para ser intuitiva, potente y con soporte completo para TypeScript, Chronos simplifica el trabajo con fechas, zonas horarias, internacionalización y operaciones complejas.

🚀 Características Principales

  • Manejo de fechas inmutable y type-safe
  • 🌍 Soporte completo para zonas horarias
  • 🈴 Internacionalización integrada
  • 🧩 API fluida y expresiva
  • Precisión en cálculos temporales
  • 📦 Ligera y sin dependencias
  • 📅 Soporte para operaciones complejas con fechas
  • 🛠 100% compatible con TypeScript

📦 Instalación

Instala Chronos usando npm o yarn:

npm install chronos-ultimate
# o
yarn add chronos-ultimate

💡 Uso Básico

import Chronos from "chronos-ultimate";

// Crear una fecha actual
const ahora = Chronos.now();

// Crear una fecha específica
const miCumple = new Chronos("1990-05-15");

// Manipulación
const proximaSemana = ahora.add({ days: 7 });
const ayer = ahora.subtract({ days: 1 });

// Formateo
console.log(ahora.format("DD/MM/YYYY")); // "15/11/2023"
console.log(ahora.format("dddd, MMMM D, YYYY")); // "Miércoles, Noviembre 15, 2023"

// Comparación
if (proximaSemana.isAfter(ahora)) {
  console.log("La próxima semana es después de hoy");
}

// Internacionalización
const espanol = ahora.setLocale({
  months: ["Enero", "Febrero" /*...*/],
  weekdays: ["Domingo", "Lunes" /*...*/],
});
console.log(espanol.format("MMMM")); // "Noviembre"

// Zonas horarias
const nyTime = ahora.setTimezone("America/New_York");
console.log(nyTime.format("HH:mm Z")); // "14:30 -05:00"

📚 Documentación Completa

Consulta nuestra documentación completa para conocer todas las funcionalidades:

🤔 ¿Por qué Chronos?

| Característica | Chronos | Moment | Date-fns | Luxon | | -------------------- | ------- | ------ | -------- | ----- | | TypeScript | ✅ | ❌ | ✅ | ✅ | | Inmutabilidad | ✅ | ❌ | ✅ | ✅ | | Zonas horarias | ✅ | ✅ | ❌ | ✅ | | Internacionalización | ✅ | ✅ | ✅ | ✅ | | Tamaño (min+gzip) | 12kB | 67kB | 30kB* | 50kB | | API moderna | ✅ | ❌ | ✅ | ✅ |

*Date-fns requiere importaciones separadas para cada función

🛠 Ejemplos Avanzados

Calcular edad exacta

function calcularEdad(fechaNacimiento: Chronos): string {
  const hoy = Chronos.now();
  const años = hoy.diff(fechaNacimiento, "year");
  const ultimoCumple = fechaNacimiento.add({ years: años });
  const dias = hoy.diff(ultimoCumple, "days");

  return `${años} años y ${dias} días`;
}

Generar un rango de fechas

function generarRangoSemanal(inicio: Chronos): Chronos[] {
  return Array.from({ length: 7 }, (_, i) =>
    inicio.add({ days: i }).startOf("day")
  );
}

Manejo de feriados

const feriadosArgentina = [
  new Chronos("2023-01-01"), // Año Nuevo
  // ... otros feriados
];

function esFeriado(fecha: Chronos): boolean {
  return feriadosArgentina.some((f) => f.isSame(fecha, "day"));
}