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

@huaqiu/huaqiu-client

v0.1.6

Published

Huaqiu Client — Ergonomic TypeScript runtime discovery and client library for HQ EDA.

Readme

@huaqiu/huaqiu-client

Ergonomic TypeScript runtime discovery and client library for HQ EDA.

Installation

npm install @huaqiu/huaqiu-client

Quick Start

import { connect } from "@huaqiu/huaqiu-client";

async function main() {
  const client = await connect();

  const projects = await client.project.listProjects({});
  console.log("Projects:", projects.projects);
}

main().catch(console.error);

Features

  • Automatic Runtime Discovery: Automatically discovers running HQ EDA instances from the local registry
  • Multi-Service Client: Provides clients for all HQ EDA services
  • Type-Safe APIs: Full TypeScript support with generated protobuf types
  • Dual Module Support: Works with both CommonJS and ES Modules
  • Connection Management: Built-in session management and transport handling

API

connect(options?: ConnectOptions): Promise<EditorClient>

Connect to an HQ EDA runtime instance.

Options:

| Option | Type | Description | |--------|------|-------------| | instanceId | string | Target a specific editor instance by ID | | grpcEndpoint | string | Direct gRPC endpoint (bypasses discovery) | | sessionId | string | Custom session ID (defaults to UUID) | | timeoutMs | number | Connection timeout in milliseconds |

listEditors(): Promise<EditorInfo[]>

List all active HQ EDA editor instances.

getRuntimeDir(): string

Get the runtime registry directory path for the current platform.

EditorClient

The main client class providing access to all services:

Discovery Service

  • client.discovery — Runtime discovery operations

Core Services

  • client.ai — AI service
  • client.capability — Capability management
  • client.context — Context service

Workspace & Project

  • client.workspace — Workspace management
  • client.project — Project operations

Canvas & Graph

  • client.kernel — Kernel operations
  • client.graph — Graph manipulation
  • client.selection — Selection management
  • client.canvasOps — Canvas operations
  • client.componentPlace — Component placement
  • client.objPlace — Object placement

ERC

  • client.erc — ERC (Electrical Rule Check) service

Runtime

  • client.runtime — Runtime management
  • client.transaction — Transaction handling
  • client.event — Event subscription

Import/Export

  • client.import — Import service
  • client.export — Export service

Context Helpers

  • client.createEditorContext() — Create editor context
  • client.createProjectContext(projectId, options) — Create project context

Examples

Connect to a specific instance

import { connect } from "@huaqiu/huaqiu-client";

const client = await connect({
  instanceId: "my-editor-instance",
});

Connect with a direct endpoint

import { connect } from "@huaqiu/huaqiu-client";

const client = await connect({
  grpcEndpoint: "localhost:8080",
});

List all running editors

import { listEditors } from "@huaqiu/huaqiu-client";

const editors = await listEditors();
console.log("Active editors:", editors);

Create project context

import { connect } from "@huaqiu/huaqiu-client";

const client = await connect();
const projectContext = client.createProjectContext("project-123", {
  workspaceId: "workspace-456",
});

Get runtime directory

import { getRuntimeDir } from "@huaqiu/huaqiu-client";

const dir = getRuntimeDir();
console.log("Runtime directory:", dir);

Runtime Discovery

The client automatically discovers HQ EDA instances by scanning the runtime registry directory:

  • Windows: %LOCALAPPDATA%\HQ\runtime
  • macOS: ~/Library/Application Support/HQ/runtime
  • Linux: ~/.hq/runtime

Each running instance registers itself via a JSON file in this directory. The client checks if the process is still alive before returning it as available.

Types

EditorInfo

interface EditorInfo {
  schemaVersion: number;
  instanceId: string;
  pid: number;
  grpcEndpoint: string;
  version: string;
  capabilities: string[];
  startedAt?: string;
}

ConnectOptions

interface ConnectOptions {
  instanceId?: string;
  grpcEndpoint?: string;
  sessionId?: string;
  timeoutMs?: number;
}

ProjectContextOptions

interface ProjectContextOptions {
  workspaceId?: string;
  transactionId?: string;
  operationId?: string;
}

Requirements

  • Node.js >= 18.0.0
  • HQ EDA runtime instance running (for automatic discovery)

License

Apache-2.0