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

@climactic/mda

v0.1.1

Published

Official TypeScript SDK and CLI for the Markdown Anything API

Readme

@climactic/mda

Official TypeScript SDK and CLI for the Markdown Anything API. Convert any document to clean markdown.

Zero dependencies. Works in Node.js, Bun, Deno, edge runtimes, and browsers.

Install

npm install @climactic/mda
# or
bun add @climactic/mda

SDK Usage

import { MarkdownAnything } from '@climactic/mda'

const mda = new MarkdownAnything('mda_your_token')

// Convert a file
const result = await mda.convert(file)
console.log(result.markdown)

// With options
const result = await mda.convert(file, {
  enhancedAi: true,
  optimizeTokens: true,
  includeMetadata: true,
})

File Inputs

The SDK accepts multiple file input types:

// File object (browser)
await mda.convert(fileInput)

// Buffer or ArrayBuffer (Node.js)
await mda.convert(buffer, { filename: 'doc.pdf' })

// File path (Node.js / Bun only)
await mda.convert('/path/to/document.pdf')

// Blob
await mda.convert(blob, { filename: 'doc.pdf' })

Async Conversions (Webhooks)

const pending = await mda.convert(file, {
  webhookUrl: 'https://example.com/hook',
  webhookSecret: 'your-secret-min-32-chars..........',
})

console.log(pending.id)     // conversion UUID
console.log(pending.status) // "pending"

// Or poll until complete
const completed = await pending.poll()
console.log(completed.markdown)

Conversion History

const list = await mda.conversions.list({ status: 'completed', page: 1 })

const detail = await mda.conversions.get('conversion-uuid')

Webhook Verification

import { verifyWebhookSignature } from '@climactic/mda'

const isValid = await verifyWebhookSignature(rawBody, signatureHeader, secret)

Error Handling

import { InsufficientCreditsError, RateLimitError } from '@climactic/mda'

try {
  await mda.convert(file)
} catch (error) {
  if (error instanceof InsufficientCreditsError) {
    console.log(`Need ${error.creditsRequired}, have ${error.creditsAvailable}`)
  }
  if (error instanceof RateLimitError) {
    console.log(`Retry after ${error.retryAfter} seconds`)
  }
}

Configuration

const mda = new MarkdownAnything('mda_your_token', {
  baseUrl: 'https://markdownanything.com', // default
  timeout: 30000,                           // ms
  fetch: customFetch,                       // override fetch
})

CLI Usage

Authentication

# Browser-based login (recommended)
mda auth login

# Manual token entry
mda auth login --token

# Direct token (scripting/CI)
mda auth login mda_your_token

# Check status
mda auth status

# Logout
mda auth logout

Convert Files

# Print markdown to stdout
mda convert document.pdf

# Write to file
mda convert document.pdf -o output.md

# With options
mda convert doc.pdf --enhanced-ai --optimize-tokens

# Full JSON response
mda convert doc.pdf --json

# Batch convert
mda convert *.pdf -o ./output/

# From stdin
cat document.pdf | mda convert --filename document.pdf

Conversion History

mda conversions list
mda conversions list --status completed --json
mda conversions get <uuid>

Environment Variables

MDA_API_KEY — overrides stored credentials.

Documentation

Full documentation at markdownanything.com/docs/sdks/javascript.

License

MIT