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

@viamrobotics/create-control

v0.3.0

Published

Scaffold a Svelte custom control UI for one model of a Viam module.

Readme

@viamrobotics/create-control

Scaffold a Svelte custom control UI for one model of a Viam module.

pnpm create @viamrobotics/control <model-name> <dir>
npm create @viamrobotics/control@latest <model-name> <dir>

<model-name> is the model's last segment (station) or its full triplet (acme:weather:station). <dir> is where the control is written, relative to the module root. A * in it stands for the model name, so '*_ui' gives station_ui/. The SDK's examples keep their controls flat in the module root this way. There is no default, since where a control lives is the module author's call.

Interactive mode

Run it with no arguments, or with -i, from the module root to add controls for several models at once. It lists the models in meta.json with the ones that have no custom_control preselected, asks for the directory pattern, shows the resulting paths, and scaffolds them after a confirmation. A pattern that maps two models to one directory is asked again. A model whose directory is not empty is reported and skipped, and the rest are still written.

What it writes

The template is copied into <dir>, with the template's svelte-control name replaced by <model-name>-control. A non-empty target directory is never overwritten, and a directory outside the module is refused since the tarball could not ship it.

meta.json

When a meta.json exists in the current directory and lists the model, its custom_control entry is set to <dir>/dist/index.html. A full triplet matches the model field exactly. A short name matches the last segment of model. If no model matches, or several share the short name, the file is left alone and the CLI says so.

Module build

When that meta.json also has a build block, the CLI makes the module's build able to produce the control on a host without Node, which is what Viam's cloud builders are. It sets build.setup to ./setup.sh, adds node and pnpm to build.darwin_deps, and writes setup.sh into the module root unless one is there. The script installs Node 22 and pnpm on Linux and does nothing where both exist. A build.setup that already names another command is left alone with a reminder that it has to install them. A manifest without a build block is not touched.

Options

  • -i, --interactive starts the interactive mode above. It takes no arguments.

Development flags

  • --sdk <spec> sets the @viamrobotics/post-message-sdk dependency in the scaffolded package.json, for example --sdk file:../../sdk.
  • --template <dir> copies a different template directory. Without it the packaged template/ is used, or templates/svelte-control in a dev checkout.

Tests

pnpm test includes an end-to-end test that packs the SDK from this repo, scaffolds two models into a temporary module, installs their dependencies from the registry, builds both, and checks the single-file artifacts and the custom_control entries in meta.json. It needs the root package built (dist/) and network access, and takes a few minutes at most.