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

@red-isbe/did-isbe-resolver

v1.4.11

Published

Resolver de did:isbe en TypeScript integrable por software de terceros

Readme

did-isbe-resolver

Librería TypeScript / ESM para resolver DIDs del método did:isbe mediante la API pública del Registro ISBE.

Proporciona una interfaz simple, ligera y directa, basada en HTTP REST y en el uso estándar del header Accept.

import { resolve, getResolver } from "did-isbe-resolver";

Características

  • Resolución de DIDs ISBE actuales

  • Resolución histórica por timestamp

  • Soporte de formatos vía Accept header:

    • application/did+json
    • application/did+ld+json
  • Función resolve() configurable por llamada

  • Función getResolver() para crear resolvers preconfigurados

  • Cliente REST directo (sin did-resolver)

  • No impone estructuras W3C internas

  • Compatible con Node.js ≥ 16 (ESM)


Instalación

npm install @red-isbe/did-isbe-resolver

Uso básico con resolve()

import { resolve } from "did-isbe-resolver";

const doc = await resolve("did:isbe:network:123456", {
  apiBaseUrl: "https://example.com/api/v1",
});

Resolución con formato específico (Accept)

const doc = await resolve("did:isbe:network:123456", {
  apiBaseUrl: "https://example.com/api/v1",
  accept: "application/did+ld+json",
});

Resolución histórica por timestamp

const doc = await resolve("did:isbe:network:123456", {
  apiBaseUrl: "https://example.com/api/v1",
  timestamp: 1700000000,
});

Uso avanzado con getResolver()

Permite crear un resolver reutilizable con configuración por defecto.

import { getResolver } from "did-isbe-resolver";

const resolver = getResolver({
  apiBaseUrl: "https://example.com/api/v1",
  accept: "application/did+json",
});

const doc = await resolver.resolve("did:isbe:network:123456");

Ejemplo completo

import { resolve, getResolver } from "did-isbe-resolver";

const API = "http://localhost:3000/api/v1";
const DID = "did:isbe:uc-dev:003f15c877845b9e8d87835d0441185d40e6f2ba";
const TIMESTAMP = Math.floor(Date.now() / 1000);

async function main() {
  // Resolución actual
  const r1 = await resolve(DID, { apiBaseUrl: API });

  // Resolución histórica
  const r2 = await resolve(DID, {
    apiBaseUrl: API,
    timestamp: TIMESTAMP,
  });

  // Resolver con JSON plano
  const resolverA = getResolver({
    apiBaseUrl: API,
    accept: "application/did+json",
  });
  const r3 = await resolverA.resolve(DID);

  // Resolver con JSON-LD
  const resolverB = getResolver({
    apiBaseUrl: API,
    accept: "application/did+ld+json",
  });
  const r4 = await resolverB.resolve(DID);

  console.log(r1, r2, r3, r4);
}

main();

API

resolve(did, options)

| Campo | Tipo | Requerido | Descripción | | ------------ | ----------------------------------------------------- | --------- | ------------------------------------ | | did | string | sí | DID completo (did:isbe:...) | | apiBaseUrl | string | sí | URL base de la API ISBE | | accept | "application/did+json" \| "application/did+ld+json" | opcional | Header HTTP Accept | | timestamp | number | opcional | Si se incluye → resolución histórica |


getResolver(options)

Crea un resolver preconfigurado que expone resolve(did).

const resolver = getResolver({
  apiBaseUrl: API,
  accept: "application/did+json",
});

const doc = await resolver.resolve(did);

Estructura del paquete

index.ts
src/
  isbeResolver.ts
  DidRegistryResolver.ts
  DidRegistryResolverConfig.ts
example.ts

Pruebas

Las pruebas unitarias están implementadas con Jest.

npm test

Cobertura actual: 100% en todos los módulos.


Documentación técnica

Consulta el documento ISBE-ART-00001.md para:

  • Arquitectura
  • Flujo de resolución
  • Reglas de validación
  • Ejemplos avanzados
  • Consideraciones de interoperabilidad

Stack tecnológico

  • TypeScript 5.9.x
  • Node.js ≥ 16 (18 recomendado)
  • Axios 1.6.x
  • Jest 29.x

Copyright © 2025 Comunidad de Madrid & Alastria Licencia Apache 2.0