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

goldsrc-bsp-viewer

v1.0.0

Published

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Version](https://img.shields.io/badge/version-1.0.0-blue.svg)](https://github.com/urgorri/goldsrc-bsp-viewer/releases)

Readme

GoldSrc BSP Viewer 🎮

License: MIT Version

A high-performance, framework-agnostic GoldSrc (Half-Life) BSP map viewer library built with Three.js. It also includes an optional React wrapper for easy integration.


🎥 Demo

GoldSrc BSP Viewer Demo 1


🚀 Quick Start (Vanilla JS)

Install the library via npm:

npm install goldsrc-bsp-viewer

Integrate it into any DOM container:

import { BspViewer } from 'goldsrc-bsp-viewer';

const viewer = new BspViewer({
  container: document.getElementById('viewer-root'),
  antialias: true
});

// Load a map (buffers can be obtained via fetch, file inputs, etc.)
await viewer.loadMap(bspArrayBuffer, [wadArrayBuffer1, wadArrayBuffer2]);

⚛️ React Usage

The library includes a ViewerCanvas component for React applications.

import { ViewerCanvas } from 'goldsrc-bsp-viewer';

function App() {
  return (
    <div style={{ width: '100vw', height: '100vh' }}>
      <ViewerCanvas
        pvsEnabled={true}
        showPointEntities={true}
        // ... other options
        onProgress={(percent, message) => console.log(`${message}: ${percent}%`)}
      />
    </div>
  );
}

✨ Features

  • 🚀 BSP v30 Parsing: Robust parsing of GoldSrc map files.
  • 🖼️ WAD3 Support: Dynamic loading of external textures from multiple .wad files.
  • 💡 Advanced Lightmapping: High-quality lighting using atlas-based lightmaps with overbrightening and gamma correction.
  • 🔍 Entity Inspector: Interactive selection and inspection of entity key-value pairs.
  • 🔗 Entity Connections: Visualize target and targetname relationships.
  • 🏗️ FGD Integration: Support for FGD files for meaningful entity metadata.
  • 🕹️ FPS Controls: Smooth noclip movement with acceleration and friction.
  • 🛠️ Customization: Toggleable wireframes, axes, transparency, and texture filtering.

📖 Detailed Usage

Initializing the Viewer

The BspViewer constructor accepts an options object:

const viewer = new BspViewer({
    container: HTMLElement,      // Required
    backgroundColor: number,     // Default: 0x050505
    antialias: boolean,          // Default: true
    showAxes: boolean,           // Default: true

    // Callbacks
    onProgress: (percent, msg) => { ... },
    onEntitySelect: (entity) => { ... },
    onLockChange: (locked) => { ... },

    // Rendering Options
    pvsEnabled: boolean,
    textureFiltering: boolean,
    lightmapFiltering: boolean,
    // ... and more
});

Loading Files

You need to provide the files as ArrayBuffer. Here is a common pattern using fetch:

async function loadMap(mapName) {
    const bspResponse = await fetch(`/maps/${mapName}.bsp`);
    const bspBuffer = await bspResponse.arrayBuffer();

    const wadResponse = await fetch(`/textures/halflife.wad`);
    const wadBuffer = await wadResponse.arrayBuffer();

    await viewer.loadMap(bspBuffer, [wadBuffer]);
}

Event Handling

viewer.addEventListener('progress', ({ percent, message }) => {
    console.log(`Loading: ${percent}% - ${message}`);
});

viewer.addEventListener('entitySelect', (entity) => {
    if (entity) console.log('Selected entity class:', entity.classname);
});

🕹️ Controls

| Action | Control | | :--- | :--- | | Move | W A S D | | Up / Down | Space / Left Ctrl | | Sprint | Hold Shift | | Look Around | Mouse (Click to lock) | | Select Entity | Left Click (While locked) | | Unlock Mouse | Esc |


🤝 Contributing

Contributions are welcome! Please see CONTRIBUTING.md for guidelines.

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👤 Author

Gastón Urgorri


Developed with ❤️ for the GoldSrc modding community.