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

wbl

v0.3.0

Published

Webpack Bundle Loader - Load, analyze, and interact with webpack bundles

Readme

WBL

Webpack Bundle Loader - Load and analyze webpack bundles in Node.js.

Security Warning

⚠️ IMPORTANT: WBL uses eval() to parse webpack bundles and executes bundle code when modules are required. This means:

  • Code Execution: Bundle code runs in your Node.js process with full system access
  • Only Load Trusted Bundles: Never load bundles from untrusted sources
  • No Sandboxing: There is no isolation between bundle code and your application
  • Use at Your Own Risk: Suitable for development, analysis, and trusted bundles only

For production use with untrusted bundles, consider implementing additional sandboxing (e.g., using Node.js vm module with restricted contexts).

Install

npm install wbl

Quick Start

# List modules
wbl list -b bundle.js

# Search (--api for API endpoints only)
wbl search <pattern> -b bundle.js
wbl search query --api -b bundle.js

# Inspect (--deep for source analysis)
wbl inspect <id> -b bundle.js
wbl inspect <id> --deep -b bundle.js

# Dependencies (--graph for Mermaid diagram)
wbl deps <id> -b bundle.js
wbl deps <id> --graph -b bundle.js

# Source with source map
wbl source <id> -b bundle.js --sourcemap bundle.js.map

# Interactive REPL
wbl repl bundle.js

Commands

| Command | Description | |---------|-------------| | list | List modules (--category to filter) | | search | Search by pattern (--api for endpoints) | | inspect | View exports (--deep for analysis) | | deps | Dependencies (--graph for diagram) | | source | View source code (--sourcemap for original) | | call | Call a method | | info | Bundle info | | repl | Interactive mode |

Global Options:

  • --json - Output as JSON (for scripts)

Programmatic API

import { WebpackBundleLoader, ModuleAnalyzer, SourceMapResolver } from 'wbl';

// Sync loading
const loader = new WebpackBundleLoader();
loader.loadBundleSync('bundle.js');

// Or async with source map
await loader.loadBundle('bundle.js', { loadSourceMap: true });

// Get original source (if source map loaded)
const original = loader.getOriginalSource('./src/module.ts');

// Analyze modules
const analyzer = new ModuleAnalyzer(loader);
const modules = analyzer.listModules();
const exports = analyzer.analyzeExports('moduleId');

// Use extractors directly
import { extractApiEndpoints, categorizeModule } from 'wbl';
const endpoints = extractApiEndpoints(sourceCode);
const categories = categorizeModule(sourceCode);

Source Map Support

Load source maps to view original TypeScript/ES6+ source:

// Automatic loading from bundle
const resolver = new SourceMapResolver();
await resolver.loadFromBundle('bundle.js');

// Or from file
await resolver.loadFromFile('bundle.js.map');

// Get original sources
const sources = resolver.getSources();
const content = resolver.getSourceContent(sources[0]);

Documentation

Memory Usage

WBL loads entire bundles into memory and caches executed modules. For large bundles:

  • Memory Footprint: Entire bundle content is kept in memory
  • Module Caching: Executed modules are cached (use reset() to clear)
  • Source Maps: Additional memory is used when source maps are loaded
  • Cleanup: Call loader.reset() when done to free resources, especially source map consumers

License

MIT