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

@study-lenses/trace-js-klve

v0.1.1

Published

JavaScript execution tracer for @study-lenses — traces JS code via Babel instrumentation

Readme

@study-lenses/trace-js-klve

npm version License: MIT

JavaScript execution tracer for @study-lenses/tracing — instruments JS/MJS/CJS code via Babel and returns step-by-step execution traces.

Pedagogical Purpose

Neutral infrastructure: This package provides raw JavaScript execution traces for educational tool developers. It makes no pedagogical decisions — those belong in the tools that consume it.

The trace data is deliberately granular: every expression evaluation, variable read, function call, and control-flow step is captured. Educational tools decide which subset to show and how to present it.

Who Is This For

Primary — Educational tool developers: Building Study Lenses, custom analysis tools, or other learning environments that need JS execution traces.

Secondary — CS instructors: Using this package directly to build course-specific debugging aids or step-through visualizations.

Install

npm install @study-lenses/trace-js-klve

Quick Start

import trace from '@study-lenses/trace-js-klve';

const steps = await trace('let x = 1 + 2; console.log(x);');
console.log(steps);
// → [{ step: 1, category: 'expression', type: 'BinaryExpression', ... }, ...]

API Summary

@study-lenses/trace-js-klve pre-configures all four @study-lenses/tracing wrappers with the js-klve tracer:

| Export | Description | |--------|-------------| | trace(code, config?) | Positional args, throws on error. Default export. | | tracify | Chainable builder with tracer pre-set, throws on error. | | embody({ code, config? }) | Keyed args, returns Result (no throw). | | embodify({ code?, config? }) | Immutable chainable builder, returns Result. |

See DOCS.md for the full API reference and filter options.

Design Principles

What this package provides

  • Step-by-step execution traces for JS/MJS/CJS code
  • Babel-based instrumentation (AST-level, no runtime monkey-patching)
  • Configurable post-trace filtering (by node type, name, timing, data fields)
  • The four standard @study-lenses/tracing wrappers, pre-bound to this tracer

What this package does NOT do

  • Make pedagogical decisions (what to show, how to explain)
  • Persist or accumulate traces across calls
  • Support languages other than JS/MJS/CJS

Architecture

code → Babel instrumentation → execution → raw steps → filter → JsKlveStep[]

The tracer internals (record/tracer.ts, record/filter-steps.ts, etc.) are pre-existing code by Kelley van Evert (jsviz.klve.nl), wrapped by record/index.ts which adapts the output to the @study-lenses/tracing RecordFunction contract.

See DEV.md for full architecture, conventions, and the TDD workflow.

Contributing

See CONTRIBUTING.md and DEV.md.

License

MIT © 2025 Evan Cole