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

bcv-exchange-rate

v1.0.1

Published

Librería profesional de Node.js para el rastreo de indicadores económicos oficiales de Venezuela (BCV) y Colombia (TRM - COP). Especializada en monedas fronterizas.

Downloads

217

Readme

bcv-exchange-rate

npm version npm downloads CI Coverage License: MIT TypeScript Node

Librería profesional de Node.js para consultar indicadores económicos oficiales de Venezuela (BCV) y Colombia (TRM). Extrae los datos directamente del Banco Central de Venezuela y del portal de datos abiertos del Gobierno de Colombia, con tipado estricto, reintentos con backoff, caché en memoria activa por defecto, jerarquía de errores tipada y logger basado en interfaz, sin dependencias forzadas.


Características

  • Multi-indicador. Tasas oficiales del BCV (USD, EUR, CNY, TRY, RUB) y TRM de Colombia (COP).
  • Historial bancario paginado. Tasas de compra y venta por institución financiera venezolana.
  • Reintentos automáticos con backoff exponencial configurable.
  • Caché en memoria con TTL por llamada y stale-while-error opcional.
  • Jerarquía de errores tipada (NetworkError, TrmApiError, ValidationError).
  • Logger basado en interfaz. Compatible con winston, pino, bunyan o console, sin dependencias forzadas.
  • TLS seguro por defecto (strictSSL: true), con desactivación explícita cuando sea necesario.
  • Dual CJS/ESM con declaraciones .d.ts.
  • Estado por sección (status.current, status.history) para detectar fallos parciales.
  • Cobertura del 100 % forzada en CI.

Instalación

npm install bcv-exchange-rate

Requiere Node.js 20 LTS o superior. Si usas winston como logger (opcional):

npm install winston

Inicio rápido

import { getBcvRates, getTrmRates } from 'bcv-exchange-rate';

const bcv = await getBcvRates({ currencies: 'USD', includeHistory: false });
console.log(`USD/VES: ${bcv.current.USD} (vigencia ${bcv.effectiveDate})`);

const trm = await getTrmRates({ limit: 1 });
console.log(`TRM: ${trm?.current.value} COP`);

Versión CommonJS:

const { getBcvRates } = require('bcv-exchange-rate');

Ejemplo con caché y reintentos

const bcv = await getBcvRates({
  currencies: ['USD', 'EUR'],
  retries: 3,
  retryDelayMs: 500,
  cacheTtlMs: 60_000,
  cacheStaleTtlMs: 10 * 60_000,
});

if (bcv.status.current === 'failed') {
  console.warn('Tasa actual no disponible; se usa el historial como alternativa');
}

Documentación

La documentación extendida vive en docs/:

Primeros pasos

Referencia

Guías temáticas

Operaciones

Desarrollo

npm install
npm test             # Jest con cobertura del 100 % forzada.
npm run lint         # ESLint.
npm run format       # Prettier.
npm run build        # Dual CJS/ESM más declaraciones.

Más detalles en CONTRIBUTING.md.

Seguridad

Reporta vulnerabilidades según lo descrito en SECURITY.md. No abras incidencias públicas para problemas de seguridad.

Autor

José Carrillo — Senior Fullstack Developer y Tech Lead con más de diez años de experiencia construyendo software escalable, eficiente y seguro.

Stack habitual: NestJS, Go, React, React Native, Kotlin, Swift y Python sobre PostgreSQL y MongoDB.

Website Email Blog GitHub LinkedIn X Dev.to Medium Stack Overflow Telegram YouTube

Proyectos adicionales: carrillo.app/proyectos. Publicaciones técnicas: github.com/carrilloapps/papers. CV: carrillo.app/cv.pdf.

Apoyar el proyecto

Si esta librería te resulta útil, puedes invitarme un café o patrocinar el desarrollo continuo:

Buy Me a Coffee GitHub Sponsors

Licencia

Distribuida bajo la licencia MIT. © José Carrillo.