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

vrowzer

v0.0.0

Published

Embeddable live preview system with HMR, powered by Vite dev server in the browser

Readme

vrowzer

Vite dev server in the browser.

Embeddable live preview system with HMR support. Mount a Vite-powered preview iframe into your app with a simple API — no back-end server required.

💿 Installation

# npm
npm install vrowzer

# pnpm
pnpm add vrowzer

# yarn
yarn add vrowzer

You also need the Vite plugin:

pnpm add -D @vrowser/vite-plugin

🚀 Usage

1. Configure Vite

// vite.config.ts
import { Vrowser } from '@vrowser/vite-plugin'
import { defineConfig } from 'vite'

export default defineConfig({
  plugins: [
    Vrowser({
      serviceWorkerEntry: './node_modules/vrowzer/dist/service-worker.ts'
    })
  ]
})

2. Use in your app

import { Vrowser } from 'vrowzer'

const vrowser = Vrowser({ basePath: '/__preview__/' })

// Initialize with files
const ready = await vrowser.ready({
  files: {
    '/main.js': `
      document.getElementById('app').innerHTML = '<h1>Hello!</h1>'
      if (import.meta.hot) { import.meta.hot.accept() }
    `
  }
})

if (ready) {
  // Mount preview iframe into a container element
  vrowser.mount(document.getElementById('preview-container'))
}

// Update files (triggers HMR)
vrowser.updateFile(
  '/main.js',
  `
  document.getElementById('app').innerHTML = '<h1>Updated!</h1>'
  if (import.meta.hot) { import.meta.hot.accept() }
`
)

📖 API

Vrowser(options?)

Creates a new Vrowser instance.

Options:

| Option | Type | Default | Description | | ---------------------- | -------- | ----------------- | -------------------------------- | | basePath | string | '/__preview__/' | Base path for the preview system | | serviceWorkerVersion | string | 'vrowzer-v1' | SW version for cache management | | serviceWorkerScope | string | '/' | SW registration scope |

Instance Methods

ready(config): Promise<boolean>

Initializes the preview system: creates Web Worker and Service Worker, establishes a MessageChannel between them, and syncs initial files.

const ready = await vrowser.ready({
  files: {
    '/main.js': 'console.log("hello")',
    '/style.css': 'body { color: red }'
  }
})

mount(container): void

Mounts a preview iframe into the given DOM element. The iframe uses credentialless and sandbox="allow-scripts allow-same-origin" attributes, and loads content via the Service Worker using a srcdoc bootstrap.

vrowser.mount(document.getElementById('preview'))

updateFile(path, content): void

Updates a file in the virtual filesystem. Triggers HMR if the preview supports it.

vrowser.updateFile('/main.js', 'console.log("updated")')

addFile(path, content): void

Adds a new file to the virtual filesystem.

deleteFile(path): void

Deletes a file from the virtual filesystem.

reloadPreview(): void

Reloads the preview iframe.

🏗️ Architecture

Architecture

📚 API References

See the API References

🤝 Sponsors

©️ License

MIT