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

@procedures/vite

v0.1.0

Published

Vite as procedures: dev server, build, preview and stop, with no shell and managed processes.

Readme

@procedures/vite

npm

npm install @procedures/vite

client-vite starts Vite as procedures: a development server, a build, a preview server, and the stop of a server.

| Procedure | Input | Output | |---|---|---| | vite.dev | cwd, port, host, open | { serverId, url, pid } | | vite.build | cwd, outDir, mode | { success, outDir } | | vite.preview | cwd, port | { serverId, url, pid } | | vite.stop | serverId | { success } |

All input fields are optional, except serverId. Without cwd, a procedure uses the current folder.

Use

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/vite"; // registers vite.*

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));

const server = await client.exec(["vite", "dev"], { cwd: "/path/to/app", port: 5173 });
console.log(server.url); // for example http://localhost:5173/

await client.exec(["vite", "stop"], { serverId: server.serverId });

const build = await client.exec(["vite", "build"], { cwd: "/path/to/app", mode: "production" });
console.log(build.outDir); // the absolute path of the output folder

From the command line:

node packages/mark/dist/cli.js vite build --cwd packages/site

How it works

  • The procedures start the Vite of the project: they find vite from cwd, and they start its bin with Node. They use no shell and no npx, so a value cannot start a command, and nothing is downloaded (deep dive WRP-8). A project without Vite gets an error that tells you to add it.
  • A value of host, mode or outDir that starts with - is an error.
  • vite.dev and vite.preview wait until Vite prints its local URL, for 30 seconds at most. A server that does not get ready stops, and the procedure fails.
  • The servers are records of the process registry of client-shell (group vite). vite.stop stops the server and the processes that it started. The servers stop when the host process stops.
  • vite.build waits for the end of the build. A failed build is an error with the output of Vite.

Related packages

  • client-shell: the process registry and runCommand().
  • client-node: Node processes as procedures.