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 🙏

© 2025 – Pkg Stats / Ryan Hefner

virtual-machine

v0.3.0

Published

RISCV Virtual Machine with WASM and Node.js native support

Readme

RISC-V Virtual Machine

A complete RISC-V 64-bit (RV64GC) virtual machine implementation in Rust, capable of running modern operating systems like Linux (xv6) and custom bare-metal kernels. It is designed to run both natively and in the browser via WebAssembly.

Features

  • Core: Full RV64GC instruction set implementation (IMAFDC + Zicsr + Zifencei).
  • Memory: Sv39 Virtual Memory Management Unit (MMU) with TLB.
  • Peripherals:
    • UART: 16550-compatible serial console.
    • PLIC: Platform-Level Interrupt Controller.
    • CLINT: Core Local Interruptor (Timer).
    • VirtIO: Block Device (Disk) and Network Device (Net).
  • Networking:
    • Native TAP interface support (Linux).
    • WebSocket backend for browser/cross-platform networking.
    • WebTransport backend for P2P connectivity.
  • Platform:
    • WASM: Compiles to WebAssembly for browser execution.
    • Native: Runs as a CLI application on Host OS.

Usage

CLI (Native)

Run the emulator from the command line:

# Run a kernel image
cargo run --release -- --kernel path/to/kernel

# Run with networking (WebSocket backend)
cargo run --release -- --kernel path/to/kernel --net-ws ws://localhost:8765

# Run with block device
cargo run --release -- --kernel path/to/kernel --disk path/to/fs.img

WebAssembly

The VM exposes a simple API for JavaScript integration:

import { WasmVm } from "virtual-machine";

// Initialize VM with kernel binary
const vm = new WasmVm(kernelBytes);

// Connect networking
vm.connect_network("ws://localhost:8765");

// Step execution
while (running) {
  vm.step();
}

Architecture

The VM follows a modular design:

  • cpu.rs: Instruction decoder and execution pipeline.
  • mmu.rs: Virtual address translation.
  • bus.rs: Memory mapping and device routing.
  • virtio.rs: VirtIO device implementations.
  • net.rs: Network backend abstraction.

Build

# Build native CLI
cargo build --release

# Build WASM package
wasm-pack build --target web