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

@kymoscope/sdk

v0.25.0

Published

The Kymoscope data engine and charts for the browser: import large measurement files, plot them, stream live data end-to-end encrypted.

Readme

@kymoscope/sdk

The Kymoscope data engine and its charts, without the app UI. The Kymoscope app (app.kymoscope.com) is the finished product; this package is the engine underneath it, so you can build your own interface around the same capabilities:

  • import files and whole folders, including files too large for memory (DuckDB-WASM, out of core): delimited text (CSV, TSV, .dat, .txt) and binary measurement files, MF4/MDF 3 (CAN decoded with a .dbc dropped alongside), EDF/BDF(+), XDF, TDMS, HDF5, MAT v5/v7.3 and COMTRADE; multi-rate files are combined on the fastest rate (datasets.splitByRate gives one dataset per group), with cancel, progress and a channel chooser for very wide files
  • laps, overlays, dataset colours and time offsets
  • worksheets of charts with a shared X axis and linked zoom
  • 27 chart kinds, mounted as bare plots into your own elements
  • math channels (formula columns) with an optional store adapter
  • local and end-to-end encrypted live streams
  • workspace / worksheet / chart import and export as JSON
  • plan limits enforced by the engine and reported as events

Nothing you load goes through Kymoscope servers, except live streams relayed as ciphertext if you use them. The Kymoscope app is built on this package through the same public API (src/PlatformApp.tsx and src/workspace/Workspace.tsx are the reference host).

Install

npm install @kymoscope/sdk react react-dom

Or a script tag, pinned to a version: https://cdn.jsdelivr.net/npm/@kymoscope/[email protected]/dist/kymoscope-embed.js and …/dist/styles/charts.css (workers and DuckDB-WASM load from the same CDN folder). To self-host, copy node_modules/@kymoscope/sdk/dist into your static files (see Script tag below).

In this repo, build with npm -w @kymoscope/sdk run build.

| Output | Use | |---|---| | dist/kymoscope-sdk.js | ESM entry @kymoscope/sdk (react/react-dom 19 are peers: charts render with React) | | dist/react.js | ESM entry @kymoscope/sdk/react (provider, hooks, <Chart>) | | dist/kymoscope-embed.js | Standalone <script>: React bundled, global Kymoscope.createEngine | | dist/assets/* | Web workers; keep them next to the JS file | | dist/types/ | TypeScript declarations | | dist/styles/charts.css | Chart styles and colour variables; load it once | | dist/styles/tokens.css | Optional: Kymoscope's own theme tokens and its typeface (Plus Jakarta Sans, @font-face on the woff2 files in dist/styles/fonts/, SIL OFL 1.1 in fonts/OFL.txt); keep fonts/ next to it |

In the repo the package exports point at src/, so the app, site and admin build from source. npm pack and npm publish swap them for the dist/ entries (scripts/pack-manifest.mjs, restored afterwards); publishing runs only in GitHub Actions (.github/workflows/publish-sdk.yml).

Script tag

<link rel="stylesheet" href="/vendor/kymoscope/styles/charts.css" />
<div id="chart" style="height: 360px"></div>
<script src="/vendor/kymoscope/kymoscope-embed.js"></script>
<script>
  const engine = Kymoscope.createEngine({ licenseKey: '…' })
  engine.datasets.addColumns({ name: 'Run 42', columns: { t, speed, rpm }, units: { speed: 'km/h' } })
  const chartId = engine.charts.add('multiband', { title: 'Speed & RPM' })
  engine.charts.addSeries(chartId, 'speed')
  engine.charts.addSeries(chartId, 'rpm')
  const view = engine.charts.mount(chartId, document.getElementById('chart'))
</script>

See examples/embed.html (run npx http-server packages and open /sdk/examples/embed.html).

React

import { createEngine } from '@kymoscope/sdk'
import { Chart, KymoscopeProvider, useEngine, useEngineState } from '@kymoscope/sdk/react'
import '@kymoscope/sdk/styles/charts.css'

// Create in an effect (and dispose in its cleanup) when the engine belongs to a component.
const engine = createEngine({ licenseKey: LICENSE_KEY })

function Charts() {
  const charts = useEngineState((s) => s.worksheets.find((w) => w.id === s.activeWorksheetId)!.charts)
  return charts.map((c) => (
    <Chart key={c.id} id={c.id} style={{ height: 300 }} onStatus={…} onContextMenu={…} viewRef={…} />
  ))
}

<KymoscopeProvider engine={engine}><Charts /></KymoscopeProvider>

The engine

createEngine(options) returns:

| Member | Purpose | |---|---| | getState(), subscribe(fn), on(event, fn) | Immutable EngineState; events change, limit, error, import | | datasets | importFiles, warmImport, splitByRate, combine, chooseChannels, addColumns, addText, configure (parse config, laps), select/toggle, setColor, setOffset, remove, raw, columnBounds | | folders | pick, canPick, fromFileList, fromDataTransfer, tree, isImportable | | worksheets | add, rename, remove, reorder, activate, setXKey | | charts | add, update, replaceSettings, rename, setBackground, remove, series ops (addSeries, updateSeries, …), layout metadata, mount, setFonts, kinds | | view | setXRange, resetZoom, setLiveWindow | | mathChannels | create, update, remove, importMany, importFile, exportBlob, preview, sync | | live | openLocal, connect(descriptor, password), disconnect, rowCount | | io | exportWorkspace/Worksheet/Chart, importWorkspace/Worksheet/Chart, parseFile, snapshot/restore, reset | | data | merged(): the plotted data as one table | | setOptions, licensed, isLicensed, dispose | Runtime options (limits, relay, store), license state, teardown |

Options (all optional): licenseKey, limits, mathChannels (a MathChannelStoreAdapter), live.relay ({ url, getToken(streamId) }), beforeImport.

Charts have no toolbar, menu or placeholder copy. A ChartView (from engine.charts.mount or <Chart viewRef>) reports status ('no-data' | 'empty' | 'ready'), contextmenu and viewchange, and offers exportPng(), setShiftMode(), autoscale(), setOptions() and destroy(). Style charts with --chart-bg, --chart-muted, --chart-grid, --accent and data-color-scheme="light" | "dark".

Failures throw KymoscopeError with a code (limit_reached carries detail.reason).

Encrypted live streams for your users

  1. Publish with the Python kymoscope package (pip install kymoscope, Python 3.9+), the native LMU plugin, or the raw protocol, using your Kymoscope API key and a stream password.
  2. Your backend asks for a watch ticket. The API key must never reach the browser:
    POST {SUPABASE_URL}/functions/v1/stream-watch-ticket
    x-api-key: kymoscope_…
    {"streamId": "<uuid>"}
    → {"ticket": "wt.…", "expiresIn": 120, "stream": { "id", "name", "salt", "key_check" }}
  3. The browser connects with that ticket and the stream password:
    const engine = Kymoscope.createEngine({ live: { relay: { url: RELAY_URL, getToken: async (id) => (await myTicket(id)).ticket } } })
    await engine.live.connect((await myTicket(streamId)).stream, password)

A ticket admits watching one stream for 2 minutes (the SDK renews it on open sockets) and nothing else. The relay only forwards ciphertext; frames are decrypted in the viewer's browser (PBKDF2-600k, AES-256-GCM).

Operator setup: set the same random WATCH_TICKET_SECRET on the relay Worker (wrangler secret put WATCH_TICKET_SECRET) and as a Supabase edge secret, and deploy stream-watch-ticket with verify_jwt = false.

Licensing

A license key is an offline-verified Ed25519 signature over { sub, domains, exp }. Domains can use wildcards (*.acme.com).

  • Without a valid key everything works, and every mounted chart shows a small "Powered by Kymoscope" badge. engine.licensed resolves to the result.
  • Every host needs a key that lists it, localhost included.
  • Terms: LICENSE.md (proprietary). Removing the attribution or tampering with the check is not permitted.
node scripts/license.mjs keygen --out ~/.kymoscope/kymoscope-license-private.jwk   # once; keep it secret
node scripts/license.mjs sign --key ~/.kymoscope/kymoscope-license-private.jwk \
  --sub acme --domains app.acme.com,*.acme.io --days 365

The public key is compiled in (KYMOSCOPE_LICENSE_PUBLIC_KEY, src/embed/license.ts). Rotating it invalidates all issued keys.

Browser/CSP notes

  • Workers: needs worker-src 'self' (or the SDK's origin).
  • DuckDB-WASM: files too large for memory (over 100 million values or 300 MB) load DuckDB from assets/ (bundled, never a CDN), so allow blob: workers, connect-src 'self' blob: and script-src 'wasm-unsafe-eval'.
  • Fonts: the SDK's JavaScript loads none. Pass your page's families to engine.charts.setFonts({ sans, mono }). The optional tokens.css declares Plus Jakarta Sans from the woff2 files beside it (dist/styles/fonts/), so it is served from your origin (font-src 'self') and never from a font CDN.