For AI agents: the complete documentation index is available at https://anyformat.swc.rs/llms.txt, the full documentation bundle is available at https://anyformat.swc.rs/llms-full.txt, and this page is available as Markdown at https://anyformat.swc.rs/guide/introduction.md.

Introduction

anyformat processes the file formats of the web. The core is written in Rust, and each format family is published as a package for Node.js and for Python.

Format families

Familynpm packagePyPI package
Image@swc/anyformat-imageanyformat-image
Audio@swc/anyformat-audioanyformat-audio
Video@swc/anyformat-videoanyformat-video
Font@swc/anyformat-fontanyformat-font
PDF@swc/anyformat-pdfanyformat-pdf
Office@swc/anyformat-officeanyformat-office

Install only the families that you use. Each package contains one native module and has no runtime dependencies.

What a package does today

Each family starts with format detection. The detect function reads the leading bytes of a file and returns the format and its MIME type. It does not use the file name or the file extension.

Decoding, encoding, and conversion will be added per family.

One API for Node.js and Python

The Node.js package and the Python package of a family have the same API. Each language uses its own naming style:

Node.jsPython
supportedFormats()supported_formats()
mimeTypemime_type
nullNone

Status

The packages are at version 0.1.0. The API can change before version 1.0. The Rust crates are not published to crates.io yet.