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

vite-plugin-stdlib

v0.0.1

Published

A Vite plugin to polyfill Node.js standard library modules for browser usage.

Readme

vite-plugin-stdlib

A Vite plugin to polyfill Node.js standard library modules for browser usage.

npm version License: MIT

Overview

vite-plugin-stdlib is a Vite plugin that automatically polyfills Node.js standard library modules (like Buffer, process, global) for browser environments. This enables you to use packages that depend on Node.js built-ins in your browser-based Vite applications without manual configuration.

Features

  • 🔄 Automatic Polyfills: Seamlessly polyfills Node.js globals (Buffer, process, global)
  • 📦 Standard Library Support: Provides browser-compatible implementations of Node.js standard library modules
  • Vite Integration: Optimized for both development and production builds
  • 🎯 Zero Configuration: Works out of the box with minimal setup
  • 🔧 Rolldown & OXC Support: Configured for Vite's modern build tooling

Installation

npm install vite-plugin-stdlib
# or
pnpm add vite-plugin-stdlib
# or
yarn add vite-plugin-stdlib

Usage

Add the plugin to your vite.config.ts:

import { defineConfig } from 'vite'
import { stdlib } from 'vite-plugin-stdlib'

export default defineConfig({
  plugins: [
    stdlib(),
  ],
})

That's it! Now you can use Node.js globals and standard library modules in your browser code:

// These will work in the browser
console.log(Buffer.from('hello'))
console.log(process.env)
console.log(global)

How It Works

The plugin provides three main polyfills:

Buffer

Polyfills the Node.js Buffer API using the buffer package, making it available globally in the browser.

process

Polyfills the Node.js process object using the process package, providing access to process.env, process.nextTick(), etc.

global

Polyfills the Node.js global object by mapping it to globalThis (or this/self for older environments).

Standard Library Modules

Uses node-stdlib-browser to provide browser-compatible implementations of Node.js built-in modules like:

  • path
  • fs
  • stream
  • crypto
  • events
  • And many more...

Use Cases

This plugin is particularly useful when:

  • Using packages that depend on Node.js built-ins in browser environments
  • Migrating Node.js code to run in the browser
  • Working with crypto, buffer, or stream operations in the browser
  • Building isomorphic applications that share code between Node.js and browser

Comparison with Similar Tools

Unlike vite-plugin-stdlib-polyfills, this plugin is specifically designed to work with Vite 8+ and leverages modern build tools like Rolldown and OXC for optimal performance and compatibility.

License

MIT © Jinjiang

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Issues

If you encounter any issues or have questions, please file them in the issues section.