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

@unispechq/unispec-portal

v0.2.4

Published

Web portal on top of the registry for browsing services, versions, environments, and ownership, with search and diff views.

Readme

UniSpec Portal

Next.js Portal runtime package for UniSpec: multi-service aggregation, workspace state, and UniSpec Tests execution

This repository contains the @unispechq/unispec-portal package. It is a Next.js application with server-side API routes and a small CLI launcher (bin).

In the current architecture, the portal process is typically started by unispec-platform (launcher).

Ecosystem dependencies:

  • unispec-spec — UniSpec + UniSpec Tests format definition (schemas + reference docs)
  • @unispechq/unispec-core — Core Engine (loader/validator/normalizer/diff/converters)

Repository Status

This repository is in active development. Current focus:

  • Stable portal package contract for unispec-platform (dev|start, --config, stable exit codes)
  • Local multi-service aggregation (/unispec.json)
  • Workspace state (/workspace/state) stored as JSON
  • UniSpec Tests execution (/tests/run) validated via @unispechq/unispec-core

Launch Contract (CLI bin)

The package exports a unispec-portal binary:

unispec-portal dev --config ./unispec.config.json
unispec-portal start --config ./unispec.config.json

In practice this is launched through unispec-platform:

unispec portal start --config ./unispec.config.json

Options

  • --config <path|url> — path or HTTP(S) URL to unispec.config.json (required)
  • --host <host> — bind host (default: 127.0.0.1)
  • --port <port> — bind port (default: 3000)
  • --storage <type>json|sqlite (currently json implemented, sqlite planned)
  • --data-dir <path> — data directory (default: <configDir>/.unispec)
  • --open — open browser
  • --verbose — verbose diagnostic output
  • --json-errors — print errors as stable JSON

Registry / private access:

  • UNISPEC_PORTAL_REGISTRY_TOKEN — optional Bearer token used for fetching remote config/specs

Process Behavior (DX)

start runs a prebuilt Next.js standalone bundle shipped with the package (no runtime build).

  • Exit codes
    • 0 — clean shutdown
    • != 0 — startup/config/runtime error
  • Signals
    • clean shutdown on SIGINT/SIGTERM
  • Output
    • errors to stderr
    • normal logs to stdout
    • with --json-errors, errors are printed as stable JSON

Auto-build for start

In start mode, if .next/ is missing, the portal automatically runs next build and then runs next start. This is important for scenarios where the portal is started as an installed npm dependency via unispec-platform.


unispec.config.json Format

{
  "version": 1,
  "services": [
    { "name": "users", "spec": "./services/users/unispec.yaml" },
    { "name": "billing", "spec": "./services/billing/unispec.yaml" }
  ]
}

services[].spec can be either:

  • a file path (relative to the config directory)
  • an absolute path
  • an HTTP(S) URL
  • a relative URL (only when --config is an HTTP(S) URL; resolved against the config URL)

Config validation is performed on startup (fail-fast):

  • validates schema and version
  • enforces unique services[].name
  • checks that each spec exists
    • file specs are checked via filesystem access
    • URL specs are checked via HTTP HEAD (with a fallback to GET if HEAD is not supported)

Remote sources are fetched using conditional requests when possible (ETag / Last-Modified) to keep data fresh while minimizing payload transfer.


HTTP API (server-side)

Base endpoints:

  • GET /health — healthcheck
  • GET /unispec.json — aggregated UniSpec (if any service is invalid: HTTP 422)
  • GET /workspace.json — workspace metadata (urls, config, storage)
  • GET /workspace/state — JSON workspace state
  • PUT /workspace/state — atomically replace workspace state
  • POST /tests/run — execute UniSpec Tests (YAML)

/unispec.json

  • loads and parses YAML specs
  • validates each document via @unispechq/unispec-core (validateUniSpec)

Development

Requirements:

  • Node.js 18+

Install:

npm install

Run (as a Next.js app directly):

npm run dev

Run (through the CLI bin, like the launcher does):

node bin/cli.js dev --config ./unispec.config.json

Tests:

npm test

Publishing

The package is published as @unispechq/unispec-portal.

A files whitelist is used in package.json to control what is included in the npm tarball.


Related Repositories

| Repository | Purpose | |---|---| | unispec-spec | UniSpec format + UniSpec Tests schemas/examples | | unispec-core | Core Engine (validation/normalize/diff/converters) | | unispec-platform | CLI launcher (в т.ч. unispec portal dev|start) |