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

@mdgate/video

v0.6.26

Published

mdgate video converter

Readme

@mdgate/video

Convert video to Markdown in TypeScript.

@mdgate/video recognizes MP4, M4V, MOV, WebM, Matroska, and AVI, then hands the whole file to a callback you provide.

It does not ship a video model. video() is not registered by all().

Works in Node.js, Cloudflare Workers, Edge runtimes, and browsers.

npm install @mdgate/video

Why @mdgate/video

Video is not a document format. Documents that software can parse are handled deterministically. Video understanding needs a model.

This package keeps that split:

video bytes → your callback → Markdown
  • Pure TypeScript
  • No Python runtime
  • No native addons
  • No WASM runtime
  • Zero third-party runtime dependencies in this package
  • Detects common video types from their contents, not only the filename
  • Not included in all()

What it does

The converter sniffs the video type, then calls your (input) => markdown function with { bytes, mime }.

The whole file is passed through. mdgate does not decode, transcode, or extract frames.

Without a callback, conversion fails as unsupported.


Usage

import { create } from '@mdgate/core';
import { video } from '@mdgate/video';
import { ai } from '@mdgate/ai';

const media = ai({
  baseURL: 'https://api.example.com/v1',
  apiKey: process.env.API_KEY!,
  model: 'your-model',
});

const read = create([
  video(media.convertVideo),
]);

const markdown = await read(bytes, {
  path: 'clip.mp4',
});

Or pass any function:

import { create } from '@mdgate/core';
import { video } from '@mdgate/video';

const read = create([
  video(async (input) => {
    // Send input.bytes to the video model you already use.
    return '...';
  }),
]);

Node.js

import { readFile } from 'node:fs/promises';
import { create } from '@mdgate/core';
import { video } from '@mdgate/video';

const read = create([
  video(convertVideo),
]);

const bytes = new Uint8Array(await readFile('clip.mp4'));
const markdown = await read(bytes, { path: 'clip.mp4' });

Cloudflare Workers and Edge runtimes

import { create } from '@mdgate/core';
import { video } from '@mdgate/video';

const read = create([
  video(convertVideo),
]);

export default {
  async fetch(request: Request) {
    const bytes = new Uint8Array(await request.arrayBuffer());
    const markdown = await read(bytes);

    return new Response(markdown, {
      headers: {
        'content-type': 'text/markdown; charset=utf-8',
      },
    });
  },
};

Need more than video?

If your application needs to read many different file types, use the complete converter set, then add video() on top. all() does not register it.

npm install @mdgate/converters

@mdgate/video is one of the single-format packages in the open-source mdgate/converters project.

For AI agents, the same converter architecture can be used to extend read_file from text files to real-world document formats.


License

MIT