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

selva-compute

v1.1.2

Published

TypeScript library for Rhino Compute Server - Grasshopper and RhinoCommon

Readme

selva-compute

An intermediate-level TypeScript framework for building web applications with Rhino Compute and Grasshopper.

selva-compute simplifies the process of communicating with Rhino Compute, handling Grasshopper definitions, and visualizing results in the browser with Three.js.

Installation

npm install selva-compute three

(Note: three is a peer dependency if you use the visualization features)

Why this project exists

selva-compute provides a type-safe, production-ready foundation for building with Rhino Compute:

  • Type-safe API – Full TypeScript support with advanced error handling for stability
  • High-level abstractions – Use GrasshopperClient and GrasshopperResponseProcessor to get started quickly
  • Ready-to-use visualization – Integrated Three.js setup with initScene() and configurable rendering options

Whether you're building a simple solver or a complex web application, selva-compute handles the complexity so you can focus on your Grasshopper definitions.

Note: The library currently focuses on the Grasshopper endpoint but is designed to support other Rhino Compute endpoints in future releases.

Example with GrasshopperClient

// Configuration
const DEFINITION_FILE = 'my-definition.gh';
const COMPUTE_SERVER = 'http://localhost:6500';
const API_KEY = 'your-api-key';

const config = {
	serverUrl: COMPUTE_SERVER,
	apiKey: API_KEY
} as GrasshopperComputeConfig;

let client: GrasshopperClient | null = null;

// Step 1: Create and initialize the client
client = await GrasshopperClient.create(config);

// Step 2: Get definition inputs and outputs
const io = await client.getIO(DEFINITION_FILE);

// Step 3: Build input data tree from definition parameters
const inputTree = TreeBuilder.fromInputParams(io.inputs);

// Step 4: Run the computation
const result = await client.solve(DEFINITION_FILE, inputTree);

// Step 5: Process and display results
const processor = new GrasshopperResponseProcessor(result);
const { values } = processor.getValues();

Requirements

Core Requirements

  • Node.js >= 20
  • three >= 0.179.0 (required for visualization features)

Rhino Compute Compatibility

selva-compute works with both standard Rhino Compute and enhanced versions:

Standard Rhino Compute – The official McNeel repository works for basic Grasshopper solving with core features.

Enhanced Setup (Recommended) – Unlock advanced features:

  1. Selva Rhino Plugin – Grasshopper plugin that simplifies building Three.js visualizations and exporting results directly from Grasshopper. Download from Food4Rhino. Detailed documentation will be available when the Selva project is open-sourced.
  2. Custom Compute Server – Our custom branch enables:
    • Input Grouping – Organize inputs with the groupName property
    • Persistent IDs – Uniquely identify inputs across definition changes using Grasshopper object GUIDs

Features requiring the enhanced setup will be clearly marked in the documentation.

Acknowledgement

This library is built on production experience and draws from several official McNeel repositories. Where code has been adapted, it is clearly marked in the relevant files.

Key References:

License

MIT