New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@firecrawl/anydoc-wasm

Package Overview
Dependencies
Maintainers
4
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firecrawl/anydoc-wasm

WebAssembly bindings for anydoc: convert documents (doc, docx, odt, rtf, epub, pdf, presentations, spreadsheets, csv) to GitHub-Flavored Markdown in the browser

Source
npmnpm
Version
0.1.5
Version published
Weekly downloads
28K
-2.9%
Maintainers
4
Weekly downloads
 
Created
Source

@firecrawl/anydoc-wasm

WebAssembly bindings for anydoc, plus the source of the demo page at firecrawl.github.io/anydoc.

The API mirrors the Rust library, minus the path-based to_markdown: wasm has no filesystem, so conversion always starts from bytes.

npm install @firecrawl/anydoc-wasm
import init, {
  formatFromBytes,
  toMarkdownBytes,
  toDocument,
} from '@firecrawl/anydoc-wasm';

await init();

// With the format detected from the content:
const markdown = toMarkdownBytes(bytes);

// Or name it, which signature-less formats (CSV) need:
const fromCsv = toMarkdownBytes(bytes, 'csv');

// Or stop at the document model, which also carries embedded assets:
const document = toDocument(bytes);

// Format detection on its own:
formatFromBytes(bytes); // 'docx', or undefined when nothing matches

The package is built with wasm-pack --target web: it loads with a plain <script type="module"> and with bundlers that handle the new URL(..., import.meta.url) asset pattern (Vite, webpack 5, Rollup). In Node, pass the module bytes to initSync instead of calling init (see test.mjs).

Calls are synchronous: wasm runs single-threaded on the calling thread, so convert on a worker if the main thread must stay responsive.

Building

wasm-pack build wasm --release --target web --scope firecrawl
node --test wasm/test.mjs

This produces the npm package in wasm/pkg/: the module, the JS glue, and TypeScript definitions. Publishing runs from ../.github/workflows/release.yml on release tags.

Demo page

www/ holds the static demo site, which imports the module from www/pkg/. Build into that directory, then serve www/:

wasm-pack build wasm --release --target web --no-pack --out-dir www/pkg
python -m http.server -d wasm/www

../.github/workflows/pages.yml builds and deploys the same layout to GitHub Pages on every push to main.

FAQs

Package last updated on 05 Aug 2026

Related posts