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

@qt-works/log-extraction

v1.0.1

Published

Encode and decode transferable log payloads over a camera using cimbar.

Readme

@qt-works/log-extraction

English | 简体中文

@qt-works/log-extraction is a browser library for transferring binary log data through a camera-friendly visual code. It wraps a WebAssembly build of libcimbar and provides JavaScript APIs for encoding files to animated canvas frames and decoding them from a camera stream.

The package is useful when a device can show a screen but cannot easily upload logs through a network connection.

For bug reports and feature requests, please submit an issue.

Features

  • Encode a File into cimbar frames rendered on a <canvas>.
  • Decode cimbar frames from a camera stream.
  • Run frame decoding in Web Workers.
  • Ship TypeScript declaration files.
  • Include the required WebAssembly runtime assets in the npm package.

Installation

npm install @qt-works/log-extraction@latest

This installs the latest version published to npm.

Quick Start: Encode

<input type="file" id="input" /> <canvas id="canvas"></canvas>
import { Encoder, initCimbar } from "@qt-works/log-extraction";

const input = document.getElementById("input");
const canvas = document.getElementById("canvas");
const Cimbar = {};

Cimbar.onRuntimeInitialized = () => {
  const encoder = new Encoder(Cimbar, canvas);

  input.addEventListener("change", (event) => {
    const file = event.target.files[0];
    if (file) {
      encoder.encode(file);
    }
  });
};

initCimbar(Cimbar, "/index.wasm");

Quick Start: Decode

<video id="video" playsinline webkit-playsinline></video>
<canvas id="canvas" style="display: none"></canvas>
<button id="scanBtn">Scan</button>
import { Decoder, initCimbar } from "@qt-works/log-extraction";

const video = document.getElementById("video");
const canvas = document.getElementById("canvas");
const scanBtn = document.getElementById("scanBtn");
const Cimbar = {};
let decoder;

Cimbar.onRuntimeInitialized = () => {
  decoder = new Decoder(Cimbar, video, canvas, "/index.wasm", "/worker.js", {
    onInitialized: () => {
      scanBtn.addEventListener("click", () => decoder.startScan());
    },
    onSuccess: (data) => {
      const blob = new Blob([data], { type: "application/octet-stream" });
      console.log("decoded log blob:", blob);
    },
    onValidate: (isAligned) => {
      console.log("frame aligned:", isAligned);
    },
    onProgress: (progress) => {
      console.log("decode progress:", progress);
    },
    onLoadedVideoMetadata: ({ width, height }) => {
      console.log("camera size:", width, height);
    },
  });
};

initCimbar(Cimbar, "/index.wasm");

Camera access requires a secure browser context. Use HTTPS in production or localhost during development.

API Overview

initCimbar(Cimbar, wasmUrl)

Loads the WebAssembly module into the provided Cimbar runtime object.

new Encoder(Cimbar, canvas)

Creates an encoder bound to a canvas element or a canvas selector.

Common methods:

  • encode(file) starts rendering the encoded file frames.
  • togglePause(pause) pauses or resumes frame rendering.
  • destroy() clears the encoder timer.

new Decoder(Cimbar, video, canvas, wasmUrl, workerUrl, callbacks)

Creates a camera decoder.

Common methods:

  • startScan() requests camera access and starts decoding frames.
  • stopScan() stops scanning and releases camera tracks.
  • destroy() terminates workers and clears the in-memory work directory.

Callbacks:

  • onInitialized() fires after decoder workers are ready.
  • onSuccess(data) receives the decoded binary data.
  • onValidate(flag) reports whether the current frame produced valid data.
  • onProgress(progress) reports decode progress.
  • onLoadedVideoMetadata(size) reports the camera frame size.

Development

npm install
npm run build

The build writes library output to dist:

  • dist/index.js
  • dist/index.wasm
  • dist/worker.js
  • dist/types

Repository Layout

| Path | Description | | ---------------- | ----------------------------------------------- | | src/lib | Public JavaScript and TypeScript library source | | src/lib/encode | Encoder wrapper | | src/lib/decode | Browser camera decoder wrapper | | src/lib/worker | Worker-side decoder | | src/lib/wasm | WebAssembly loader and binary | | libcimbar | C++ source used to build the WebAssembly binary | | build/lib.js | Library build script |

License

Project code is licensed under Apache-2.0.

This repository also includes third-party components under their own licenses, including libcimbar, OpenCV, and several vendored C/C++ libraries. Their license files are preserved in the repository and included with the npm package. See NOTICE and THIRD_PARTY_NOTICES.md for details.