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

@virke/wasm-component

v1.1.0

Published

Wasm Component Model support for Virke applications.

Readme

@virke/wasm-component

Wasm Component Model support for Virke applications.

Overview

This package enables building Virke applications using the Wasm Component Model, a portable binary interface standard for WebAssembly. Component Model applications are more portable, composable, and future-proof than traditional Wasm modules.

Features

  • Type-safe runtime bindings for Virke services (KV, DB, OS3, logging)
  • Standard HTTP interface via wasi:http/incoming-handler
  • Componentization tooling powered by componentize-js
  • WIT definitions for the Virke world

Installation

bun add @virke/wasm-component

Usage

Basic Handler

import { defineHandler, json } from "@virke/wasm-component";

export default defineHandler(async (request) => {
  return json({ message: "Hello from Wasm Component Model!" });
});

Using Virke Runtime Services

import { defineHandler, json, kv, db, os3, logging } from "@virke/wasm-component";

export default defineHandler(async (request) => {
  // KV Store
  const value = kv.get("my-key");
  const setResult = kv.set("my-key", "my-value", 3600);

  // Database
  const queryResult = db.query("SELECT * FROM users WHERE id = ?", ["123"]);

  // Object Storage
  const getResult = os3.get("files/document.pdf");

  // Logging
  logging.log("info", "Request processed");

  return json({ value, queryResult });
});

Componentization

The componentization happens automatically during deployment via the Virke CLI. The CLI detects Component Model projects and uses componentize-js to build them.

Project Setup

Add to your virke.toml:

[project]
name = "my-component-app"
type = "component"

[compute]
entry = "src/handler.ts"

WIT Interface

The Virke runtime provides these interfaces:

  • virke:runtime/kv - Key-value store
  • virke:runtime/db - SQL database
  • virke:runtime/os3 - Object storage
  • virke:runtime/logging - Structured logging

Your component exports:

Deployment

virke deploy

The CLI will:

  1. Detect the type = "component" configuration
  2. Bundle your TypeScript/JavaScript code
  3. Run componentize-js to generate a Wasm component
  4. Upload the component to Fastly Compute@Edge

Architecture

Component Model applications on Virke run as dedicated Fastly Compute services. The Virke runtime provides host implementations of the imported interfaces (KV, DB, OS3, logging) using Fastly's native services.

┌─────────────────────────────────────┐
│   Your Component (Wasm)             │
│                                     │
│   import virke:runtime/kv           │
│   import virke:runtime/db           │
│   export wasi:http/incoming-handler │
└─────────────────────────────────────┘
              ↓
┌─────────────────────────────────────┐
│   Virke Runtime (Fastly C@E)        │
│                                     │
│   - KV Store bindings               │
│   - SQLite bindings                 │
│   - Object Storage bindings         │
└─────────────────────────────────────┘

Why Component Model?

  • Portability: Components run on any Component Model runtime
  • Composability: Components can import/export interfaces
  • Future-proof: Standard evolving with WebAssembly
  • Performance: Near-native execution speed
  • Security: Capability-based security model

License

MIT