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

@xyd-js/next-plugin

v0.0.0-build-0167722-20260922165502

Published

Next.js plugin that builds xyd docs during `next build` and serves them under a subpath of your app — with a spawned `xyd dev` + proxy rewrites in `next dev`

Readme

@xyd-js/next-plugin

xyd docs inside your Next.js app — one deployable, one origin: your app at /, your docs under /docs.

// next.config.mjs
import { withXyd } from "@xyd-js/next-plugin";

/** @type {import('next').NextConfig} */
const nextConfig = {};

export default withXyd({ docsRoot: "./docs", base: "/docs" })(nextConfig);

How it works

  • next build — runs xyd build for the docs project (child process) and merges the static output into public/ (pages under public/docs, hashed assets under public/assets — Next serves public/ at the site root). Extensionless docs URLs (/docs/overview) are mapped to the flat .html files via afterFiles rewrites, which next start and Vercel honor at runtime. A manifest (public/.xyd-docs-manifest.json) tracks the generated files so every rebuild cleans its previous output first.

    Add the generated paths to your .gitignore:

    public/docs/
    public/assets/
    public/public/
    public/.xyd-docs-manifest.json
  • next dev — spawns xyd dev (bun engine) on an internal port and proxies the mount + xyd's /_xyd/* + /_bun/* internals via rewrites to that origin. App and docs share one URL/port. (Next's rewrite proxy is HTTP-only, so the docs live-reload websocket degrades gracefully — pages and styles still work; refresh manually after edits.)

Which xyd runs?

Same resolution as @xyd-js/vite-plugin: the command option → a local xyd-js / @xyd-js/cli install → an xyd binary on PATH. Recommended: npm i -D xyd-js.

Options

Accepts the same options as @xyd-js/vite-plugin (minus outDir): docsRoot (required), base, enabled, dev, command, env, nodeOptions, sitemap/robots, timeoutMs, silent, verbose. The mount comes from base (passed to xyd via XYD_BASENAME) or the docs' own advanced.basename — the docs side wins when both are set (they must match).