@mcap/support
TypeScript icon, indicating that this package has built-in type declarations

1.0.3 • Public • Published

@mcap/support

MCAP is a modular container format and logging library for pub/sub messages with arbitrary message serialization. It is primarily intended for use in robotics applications, and works well under various workloads, resource constraints, and durability requirements.

The @mcap/support package provides utilities for working with MCAP files that use well-known compression formats, from Node.js and browsers.

Usage examples

Reading MCAP files in a browser

import { loadDecompressHandlers } from "@mcap/support";
import { BlobReadable } from "@mcap/browser";
import { McapIndexedReader } from "@mcap/core";
import { open } from "fs/promises";

async function onInputOrDrop(event: InputEvent | DragEvent) {
  const file = event.dataTransfer.files[0];
  const decompressHandlers = await loadDecompressHandlers();
  const reader = await McapIndexedReader.Initialize({
    readable: new BlobReadable(file),
    decompressHandlers,
  });
}

Reading MCAP files in Node.js

import { loadDecompressHandlers } from "@mcap/support";
import { FileHandleReadable } from "@mcap/nodejs";
import { McapIndexedReader } from "@mcap/core";
import { open } from "fs/promises";

const decompressHandlers = await loadDecompressHandlers();
const fileHandle = await open("file.mcap", "r");
const reader = await McapIndexedReader.Initialize({
  readable: new FileHandleReadable(fileHandle),
  decompressHandlers,
});

License

@mcap/support is licensed under the MIT License.

Stay in touch

Join our Discord community to ask questions, share feedback, and stay up to date on what our team is working on.

/@mcap/support/

    Package Sidebar

    Install

    npm i @mcap/support

    Weekly Downloads

    5,100

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    103 kB

    Total Files

    32

    Last publish

    Collaborators

    • foxglovebot
    • amacneil
    • defunctzombie