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

@ldlework/scope

v0.0.1

Published

Oscilloscope signal modeling — waves, sweeps, bursts. Plain TypeScript; pair with @ldlework/crt for rendering.

Readme

@ldlework/scope

Oscilloscope-style synthetic-signal generation, plus a WebGL2 deposit pass that feeds the resulting beam trace into @ldlework/crt's phosphor pipeline.

Plain TypeScript. No dials, no React, no DOM, no presets, no persistence — the application composes scope with whatever parameter system (e.g. @ldlework/dials) and persistence it wants.

import { makeWave, makeFundamental, WavePumper } from '@ldlework/scope'

const wave = makeWave()
wave.fundamentals = [makeFundamental(440, 0.5)]  // freq, amp, phase

const pumper = new WavePumper(500_000)  // beamHz
const sample = pumper.step(wave, { t, dt })
// sample: BeamPosition — { x, y, on?, beamI?, beamWidth? }

What's in the box

  • Wave model (signal/) — every wave is Σᵢ ampᵢ · sin(2π·freqᵢ·t + phaseᵢ) plus an always-on noise floor plus phase-locked bursts. No "drift" abstraction; attach an LFO to a freq dial in your own parameter layer if you want one.
  • WavePumper (signal/pumper.ts) — the runtime. Walks a Wave at the configured beam sample rate and emits BeamPositions (NDC x/y + per-sample beam character).
  • Noise generators (noise/) — white / brown / pink / drift, plus seeded variants for reproducible signal-floor noise.
  • DepositPass + SegmentPump (beam/) — the @ldlework/crt integration seam. DepositPass is a DrawablePass<DrawCtx> that additively deposits beam segments into crt's HDR accumulator via an analytical line-integral (woscope-style); SegmentPump batches a BeamFn's per-frame samples into the instance data DepositPass consumes.

Module layout

  • @ldlework/scope — everything above, one entrypoint. No React subpath: the dials-wrapped parameter layer, hero preset persistence, and <Scope>/<TuningPanel> React composition live in the demo site (apps/viz-site, pages /phosphor/ and /scope/), not in this package — scope stays parameter-system- and framework-agnostic so any host can drive it.

Wiring a beam into crt

import { useCallback, useRef } from 'react'
import { CrtSurface } from '@ldlework/crt/react'
import type { DrawablePass, DrawCtx } from '@ldlework/crt'
import { DepositPass, makeSegmentPump, type BeamFn, type SegmentPump } from '@ldlework/scope'

const CAPACITY = 4000

function Trace({ beamFn }: { beamFn: BeamFn }) {
  const depositRef = useRef<DepositPass | null>(null)
  const pumpRef = useRef<SegmentPump | null>(null)

  const passes = useCallback((gl: WebGL2RenderingContext): DrawablePass<DrawCtx>[] => {
    const deposit = new DepositPass(gl, CAPACITY)
    depositRef.current = deposit
    pumpRef.current = makeSegmentPump(CAPACITY)
    return [deposit]
  }, [])

  const stage = useCallback((t: number, dt: number) => {
    depositRef.current?.setBatch(pumpRef.current!.pump(beamFn, t, dt))
  }, [beamFn])

  return <CrtSurface passes={passes} stage={stage} />
}

License

MIT