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

@carloscortezcloud/nan-graph

v0.3.0

Published

In-memory Architecture Graph engine — NanGraph, BFS/DFS traversal, blast radius, relationship filtering, cost chain. Fusion Ñan × BYaML (SOFE Architecture Graph).

Readme

nan-graph

In-memory Architecture Graph engine — la implementación del grafo de SOFE Architecture Graph (fusión Ñan × BYaML v2). OSS, Apache-2.0, bajo breakingthecloud.

Un grafo dirigido en memoria con relaciones tipadas, para análisis de arquitectura: traversal BFS/DFS, blast radius, cost chain, fan-in / SPOF, y filtrado por tipo de relación.

Cero infraestructura: funciona en Node.js, Cloudflare Workers, Lambda. Zero deps en el core (la importación YAML usa el paquete ligero yaml).

📚 Developer Docs

Documentación completa para desarrolladores en docs/: Getting Started · Concepts · API Reference · Contribution

Install

pnpm add @carloscortezcloud/nan-graph

Uso

import { NanGraph, blastRadius, costChain, fromYaml } from '@carloscortezcloud/nan-graph';

const g = new NanGraph()
  .addNode({ id: 'api', type: 'aws.apigateway', attrs: { monthly_cost: 20 } })
  .addNode({ id: 'lambda', type: 'aws.lambda', attrs: { monthly_cost: 5 } })
  .addNode({ id: 'ddb', type: 'aws.dynamodb', attrs: { monthly_cost: 30 } })
  .addEdge({ from: 'api', to: 'lambda', relType: 'routes_to' })
  .addEdge({ from: 'lambda', to: 'ddb', relType: 'reads_writes' });

blastRadius(g, 'api');   // ['lambda', 'ddb']  — qué se cae si api falla
costChain(g, 'api');     // 55 — costo downstream total

Importar desde YAML / JSON

import { fromYaml } from '@carloscortezcloud/nan-graph';

// estilo dependency-graph.yaml
const g = fromYaml(`
nodes:
  sofe-engine: { type: python-library }
  sofe-server: { type: python-api }
edges:
  - { from: sofe-engine, to: sofe-server, relType: bundles }
`);

// estilo BYaML v0.3 (components + relationships)
const g2 = fromObject({
  components: [{ id: 'api', type: 'aws.apigateway', monthly_cost: 20 }],
  relationships: [{ from: 'api', to: 'lambda', type: 'routes_to' }],
});

API

| Función | Descripción | |---------|-------------| | new NanGraph() | Grafo dirigido multi-borde en memoria | | g.addNode(node) / g.addEdge(edge) | Añadir nodo/arista (auto-crea nodos) | | g.getRelated(id, relType?, direction?) | Vecinos outgoing/incoming/both, con filtro | | traverseBFS(g, start, opts) | Nodos alcanzables (BFS), con relTypes/maxDepth/direction | | traverseDFS(g, start, opts) | Nodos alcanzables (DFS) | | blastRadius(g, start) | Nodos afectados downstream si start falla | | costChain(g, start) | Suma attrs.monthly_cost de start + downstream | | teamCost(g, owner) | Suma de costo por attrs.owner | | fanIn(g, id) / singlePointsOfFailure(g, threshold) | SPOF por alta dependencia entrante | | fromObject(obj) / fromYaml(str) / fromJson(str) | Construir grafo desde input |

Modelo (fusión con SOFE Architecture Graph)

  • Nodo = unidad desplegable / recurso / servicio / documento (id, type, label, attrs).
  • Arista = relación dirigida tipada (from, to, relType).
  • Derivado de SOFE engine/architecture.py (blast_radius, cost_chain, fan_in, spof)
    • cc-mng graph/data.ts (GraphNode/GraphEdge) + dependency-graph.yaml como formato de input.

Sync a PyPI

El port en Python (nan-graph en PyPI) se sincroniza desde este core TS — mismo patrón que styrrstyrr-py. Ver SoW nan-001.

Licencia

Apache-2.0. Ver LICENSE.