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

@esmap/sandbox

v0.1.0

Published

JavaScript sandbox implementations for micro-frontend isolation

Downloads

73

Readme

@esmap/sandbox

JavaScript sandbox implementations for MFE isolation.

Prevents MFEs from polluting the window global object. Zero external dependencies.

Installation

pnpm add @esmap/sandbox

Proxy Sandbox

Uses ES Proxy to create a virtual window per MFE. The real window is never modified.

import { ProxySandbox } from '@esmap/sandbox';

const sandbox = new ProxySandbox({
  name: 'checkout',
  // Global properties that bypass the sandbox (default: DEFAULT_ALLOW_LIST)
  allowList: ['fetch', 'console', 'setTimeout'],
});

// Activate — window access is now proxied through the sandbox
sandbox.activate();

// MFE code runs in isolation
sandbox.proxy.myGlobal = 'scoped'; // real window.myGlobal is unchanged

// Deactivate — restore original window
sandbox.deactivate();

// Inspect
sandbox.isActive(); // boolean
sandbox.getModifiedProps(); // property keys set within the sandbox

DEFAULT_ALLOW_LIST

These globals bypass the sandbox by default:

import { DEFAULT_ALLOW_LIST } from '@esmap/sandbox';
// console, fetch, setTimeout, setInterval, clearTimeout, clearInterval,
// requestAnimationFrame, cancelAnimationFrame, ...

Snapshot Sandbox

Snapshot-based isolation for environments without Proxy support:

import { createSnapshotSandbox } from '@esmap/sandbox';

const sandbox = createSnapshotSandbox('checkout');

// Activate — snapshots the current window state
sandbox.activate();

// MFE modifies window
window.myGlobal = 'polluted';

// Deactivate — restores window from snapshot
sandbox.deactivate();
// window.myGlobal is undefined again

Snapshot Sandbox iterates all window properties on activate/deactivate, so it is slower than Proxy Sandbox. Prefer Proxy Sandbox when possible.

Usage Pattern

import { ProxySandbox } from '@esmap/sandbox';

const sandboxes = new Map<string, ProxySandbox>();

registry.onStatusChange(({ appName, to }) => {
  if (to === 'MOUNTED') {
    const sandbox = new ProxySandbox({ name: appName });
    sandbox.activate();
    sandboxes.set(appName, sandbox);
  }
  if (to === 'NOT_MOUNTED') {
    sandboxes.get(appName)?.deactivate();
    sandboxes.delete(appName);
  }
});