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

comp-hub

v1.1.4

Published

CLI for comp-hub — a component sharing platform supporting Vue and React. Start a local dev server to preview, manage, and share components.

Readme

comp-hub

CLI for comp-hub — a component sharing platform supporting Vue and React. Start a local dev server to preview, manage, and share components.

npm version Node.js

Languages: Full docs are also available in 简体中文 · 繁體中文 on our documentation site.

Website: https://www.comphub.cn  ·  Studio: https://studio.comphub.cn  ·  Docs: https://docs.comphub.cn

Requirements

  • Node.js >= 16.0.0
  • npm >= 8.0.0

Installation

Global (recommended)

npm install comp-hub@latest -g

Local

npm install comp-hub@latest -D

Quick Start

Run in your project directory:

comphub

Once started, open the URL shown in the terminal (default http://localhost:5478).

Without installing — npx fetches the CLI on demand:

npx comp-hub

The CLI is published with three binary names — comphub, ch and comp-hub — all identical. Every command below works with any of them, e.g. ch status, comp-hub -p 8080.

CLI Options

comphub [options]

| Option | Alias | Type | Default | Description | |--------|-------|------|---------|-------------| | --port | -p | number | 5478 | Server port | | --dir | -d | path | "./" | Component directory | | --version | -v | — | — | Show version | | --help | -h | — | — | Show help |

Examples:

comphub -p 8080          # Custom port
comphub -d ./src         # Custom component directory

Management Commands

| Command | Description | |---------|-------------| | comphub | Start dev server | | comphub status | List all running projects | | comphub stop <hash> | Stop a specific project | | comphub stop --all | Stop all projects | | comphub login | Sign in via browser authorization | | comphub logout | Sign out and remove stored credentials | | comphub kill | Shut down all services |

Examples:

# Check running projects
comphub status

# Stop a specific project
comphub stop 94525912

# Stop all projects
comphub stop --all

# Shut down everything
comphub kill

Multi-Project

Run multiple projects simultaneously on separate ports:

cd /path/to/project-a && comphub
cd /path/to/project-b && comphub
comphub status             # List all

Configuration

Create .comphub.json or .comphub.js in your project root:

{
  "dir": "./src"
}
module.exports = {
  dir: './src'
}

| Option | Type | Default | Description | |--------|------|---------|-------------| | dir | string | "./" | Component root directory | | proxy | object | — | Proxy rules for the preview server — see Proxy rules |

Priority: CLI flags > config file > defaults

Proxy rules

Component demos run inside an iframe and can only talk to the local dev server. proxy forwards requests matching a path to another server — the same idea as server.proxy in Vite or devServer.proxy in webpack. Use it when a demo needs an API the browser cannot reach directly: an internal backend, a third-party API without CORS headers, or another local service.

{
  "dir": "./src",
  "proxy": {
    "/api": {
      "target": "http://10.0.0.5:8080",
      "changeOrigin": true,
      "pathRewrite": { "^/api": "" }
    }
  }
}

With the config above, fetch("/__proxy__/api/users") inside a component demo is forwarded to http://10.0.0.5:8080/users.

  • Request the absolute path /__proxy__/... from the preview page — the page itself is served under /{hash}/main/, and the master routes the request back to your project.
  • The key (/api above) is matched against the path that follows /__proxy__ — prefix match, or a regular expression.
  • The value is passed straight to http-proxy-middleware; target is required, everything else is optional.
  • pathRewrite is applied after the /__proxy__ prefix is stripped.
  • Requests matching no rule get 404 {"message":"Proxy not found"}.
  • Rules are per project: only the project whose .comphub.json declares them gets them.

Component Specs

  • Upload components as folders — folder name is the component name
  • Entry point: index.vue (Vue) or index.jsx/index.tsx (React)
  • Include a README.md describing usage
  • comp.json is generated by the platform and holds only __id__, name and version — dependencies are detected from your source import statements, not declared here
  • Optional demo/ directory for preview configs

Links

License

MIT