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

@rbxts/coverage

v0.1.3

Published

Coverage instrumentation for Roblox Luau

Readme

Roblox Coverage

Code coverage instrumentation for Roblox Luau modules. This library injects lightweight probes into your ModuleScripts at runtime, collects execution hits, and emits an Istanbul-compatible JSON report that you can feed into standard coverage tooling (HTML, lcov, Cobertura, etc.).

Features

  • Runtime instrumentation of ModuleScripts (no compiler plugin required)
  • Istanbul/nyc-compatible JSON output
  • Function and branch hit tracking in addition to statements
  • Sensible include/exclude defaults (avoids Packages and the coverage folder)
  • Demo place + script to generate full HTML/text/LCOV/Cobertura reports locally

How it works

  1. coverage.instrument() walks your include roots, injects _G.__covhit, _G.__covfn, and _G.__covbranch calls into ModuleScript sources, and tracks IDs per line/function/branch.
  2. Your code runs normally; probes increment counters in _G.__COVERAGE__.
  3. coverage.istanbul() converts the collected data to an Istanbul report object you can serialize and post-process with istanbul-lib-* or CI tools.

Quick start (demo)

Prereqs: Node.js, Roblox Studio

If you do not have Roblox Studio installed, you can specify a ROBLOSECURITY environment variable of a throwaway account to run Luau on the cloud.

npm install
npm run demo

The demo will:

  • Build the example place via Rojo to demo/place.rbxl
  • Run demo/test.luau with rbxluau, which instruments and exercises sample modules
  • Emit Istanbul JSON to demo/coverage/coverage-final.json
  • Generate HTML, lcov, Cobertura, text, and JSON summary reports into demo/coverage/

Open demo/coverage/index.html in a browser to explore the report.

Using in your experience

local coverage = require(game:GetService("ReplicatedStorage").coverage)

-- Instrument common services by default; you can pass explicit roots.
coverage.instrument(
    {
        game:GetService("ServerScriptService"),
        game:GetService("ReplicatedStorage"),
        game:GetService("ServerStorage"),
        game:GetService("StarterPlayer"),
        game:GetService("StarterGui"),
    },
    {
        game:GetService("ReplicatedStorage"):FindFirstChild("Packages"),
    }
)
  1. Run your tests or gameplay to collect coverage.
  2. Export the report where you need it (e.g. to HttpService, DataStore, or a file if running in a CLI environment):
local HttpService = game:GetService("HttpService")
local report = coverage.istanbul()
local json = HttpService:JSONEncode(report)
-- Persist json as needed

Notes

  • This library destructively modifies ModuleScript sources. It's recommended to only enable coverage instrumentation in test environments.
  • The instrumentation also adds overhead; expect slower execution times when coverage is enabled.
  • Coverage JSON uses Roblox datamodel paths, not filesystem paths. You may need to map these paths when integrating with external tools.