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

terra-formica

v2.0.0

Published

Formica — The Formic Mesh: $0 Cost Event Mesh, Distributed K/V Cache, Telemetry, WAF Security Gateway & Universal Purge Engine for the Terra Ecosystem

Readme

🐜 FORMICA — The Formic Mesh: Event Mesh, K/V Cache & Universal Purging


💡 ¿Qué es FORMICA?

FORMICA (The Formic Mesh) es la plataforma distribuida de conectividad, almacenamiento de estado en caché, observabilidad y purgado efímero universal del Ecosistema Terra.

Inspirada en la organización autónoma de las colonias de hormigas, Formica actúa como el sistema nervioso central para aplicaciones en la nube y microservicios, operando con $0 de coste en servidores y cero dependencias cautivas.


🏛️ Los 6 Módulos de Formica

  1. 👑 Queen (Plano de Control & Dashboard): Consola Web interactiva 24/7 y mapa de topología en vivo.
  2. 🧪 Pheromones (Event Mesh & Pub/Sub): Bus de mensajes asíncronos por tópicos con reintentos y colas DLQ.
  3. 🕳️ Chambers (Distributed K/V Store & Cache): Almacén de estado ultrarrápido en Git/RAM con expiración TTL y tags.
  4. 🍃 Foragers (Telemetría & Log Aggregator): Ingesta de registros de auditoría y Correlation IDs.
  5. 🛡️ Soldiers (WAF Guard & Security Gateway): Rate limiting, filtro de IPs y validación de firmas HMAC.
  6. 🌾 Legionarys (Universal Purge Engine): Motor de purga modular universal: Simulación previa (Dry-Run) y ejecución de limpieza con adaptadores pluggable para Sinchlor, Rolla, Ballom, Lumina, Termes, Combase y proveedores personalizados.

🌐 Consola Web Online & Local (Queen Studio)

Accede a la consola interactiva directamente desde la web o ejecútala offline:

👉 ACCEDER A LA CONSOLA WEB ONLINE DE FORMICA


📦 Instalación Global e Instrucciones CLI

Para usar Formica desde la terminal o importar su SDK en TypeScript/Node.js, instala el paquete oficial de NPM:

npm install -g terra-formica

Comandos de la CLI Global:

| Comando | Descripción | | :--- | :--- | | formica studio --port 3740 | Lanza el servidor estático local de Formica Queen Studio en http://localhost:3740. | | formica pub --topic <t> --message <m> | Publica un evento Pub/Sub en el tópico especificado. | | formica sub --topic <t> --name <subscriber> | Crea una suscripción activa a un tópico. | | formica kv set --key <k> --value <v> --ttl 3600 | Guarda una entrada K/V en Chambers con tiempo de vida (TTL). | | formica kv get --key <k> | Consulta el valor de una clave K/V en Chambers. | | formica kv list | Lista todas las entradas K/V almacenadas. | | formica purge dry-run | Simulador Dry-Run de Purga: Muestra los elementos expirados liberables sin borrarlos. | | formica purge execute | Ejecutor de Purga: Elimina de forma limpia todos los datos expirados. |


💻 Ejemplo de Uso del SDK en TypeScript / Node.js

import { Formica } from 'terra-formica';

const formica = new Formica({
  githubToken: process.env.GITHUB_TOKEN,
  vaultId: 'default-colony'
});

await formica.init();

// 🧪 1. Publicar evento Pub/Sub (Pheromones)
await formica.publishEvent('user.signup', 'Lumina-IAM', { userId: 'usr_9981', email: '[email protected]' });

// 🕳️ 2. Guardar en K/V Chambers con TTL de 1 hora
await formica.setK/V('session_token_123', 'authenticated', 'auth-namespace', ['session'], 3600);

// 🌾 3. Ejecutar simulación Dry-Run de Purga Universal
const report = await formica.runPurgeDryRun();
console.log(`Elementos expirados encontrados: ${report.totalItemsPurged}, Bytes a liberar: ${report.bytesSaved}`);

// 🌾 4. Ejecutar Purga Real
await formica.executePurge(report);