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

convertintomp4

v1.1.0

Published

Official Node.js/TypeScript SDK for the ConvertIntoMP4 file conversion API

Readme

convertintomp4

Official Node.js/TypeScript SDK for the ConvertIntoMP4 file conversion API — 270+ formats across video, audio, image, document, archive, and font conversion, backed by 13 engines (FFmpeg, Sharp, LibreOffice, Ghostscript, Calibre, and more).

Installation

npm install convertintomp4

Requirements

  • Node.js 18+ (uses the native fetch API — no runtime dependencies)

Quick Start

Get an API key from your ConvertIntoMP4 dashboard, then:

import { readFileSync, writeFileSync } from 'node:fs';
import { ConvertIntoMP4Client } from 'convertintomp4';

const client = new ConvertIntoMP4Client({ apiKey: 'ck_your_api_key' });

// 1. Upload + convert in one call
const { jobId } = await client.convert(
  new Blob([readFileSync('clip.mov')]),
  'mp4',
);

// 2. Wait for the job to finish (polls until terminal state)
const job = await client.waitForJob(jobId, { interval: 2000, timeout: 300000 });

// 3. Download the result
if (job.status === 'completed') {
  const response = await client.downloadFile(jobId);
  writeFileSync('clip.mp4', Buffer.from(await response.arrayBuffer()));
}

The same three calls handle any supported pair. Popular conversions:

| Conversion | Try it in the browser | | --- | --- | | MOV → MP4 | convertintomp4.com/mov-to-mp4 | | MP4 → MP3 | convertintomp4.com/mp4-to-mp3 | | WEBM → MP4 | convertintomp4.com/webm-to-mp4 | | PDF → Word | convertintomp4.com/pdf-to-word | | HEIC → JPG | convertintomp4.com/heic-to-jpg |

Configuration

const client = new ConvertIntoMP4Client({
  apiKey: 'ck_your_api_key',
  baseUrl: 'https://api.convertintomp4.com/v1', // default
  sandbox: false, // true = sandbox environment
  timeout: 30000, // per-request timeout in ms
});

Usage

Quick Convert (file upload)

import { readFileSync } from 'node:fs';

const file = new Blob([readFileSync('input.mp4')]);
const result = await client.convert(file, 'mp3', {
  quality: 'high',
});
// result: { jobId, status, statusUrl }

Import from URL

const result = await client.importFromUrl('https://example.com/video.mov', {
  targetFormat: 'mp4',
});

Job-Based Conversion (task pipelines)

Multi-step jobs with named tasks, mirroring the Jobs API:

const job = await client.createJob({
  tasks: {
    'import-file': {
      operation: 'import/url',
      url: 'https://example.com/video.mov',
    },
    'convert': {
      operation: 'convert',
      input: 'import-file',
      output_format: 'mp4',
      options: { quality: 'high', resolution: '1080p' },
    },
    'export': {
      operation: 'export/url',
      input: 'convert',
    },
  },
});

const completed = await client.waitForJob(job.id, {
  interval: 2000,
  timeout: 120000,
});
console.log('Status:', completed.status);

List and Manage Jobs

const { data: jobs, meta } = await client.listJobs({ status: 'completed', limit: 10 });

const job = await client.getJob('job_abc123');
await client.deleteJob('job_abc123');
await client.cancelJob('job_abc123');
await client.retryJob('job_abc123');

Formats

const formats = await client.listFormats();          // all formats
const videoFormats = await client.listFormats('video'); // by category
const options = await client.getFormatOptions('mov', 'mp4');

Webhooks

const webhook = await client.createWebhook(
  'https://your-app.com/webhook',
  ['job.completed', 'job.failed'],
  { secret: 'your-webhook-secret' },
);

const webhooks = await client.listWebhooks();
await client.deleteWebhook(webhook.id);

PDF Operations

// OCR
await client.pdfOcr({ file: 'https://example.com/scan.pdf', language: 'eng' });

// Split / merge
await client.pdfSplit({ file: 'https://example.com/doc.pdf', ranges: ['1-3', '4-6'] });
await client.pdfMerge({ files: ['https://example.com/a.pdf', 'https://example.com/b.pdf'] });

// Compress, encrypt, watermark, extract, rotate
await client.pdfCompress({ file: 'https://example.com/doc.pdf' });
await client.pdfEncrypt({
  file: 'https://example.com/doc.pdf',
  password: 'secure123',
  permissions: { printing: true, copying: false },
});
await client.pdfWatermark({
  file: 'https://example.com/doc.pdf',
  text: 'CONFIDENTIAL',
  opacity: 0.3,
});
await client.pdfExtractPages({ file: 'https://example.com/doc.pdf', pages: [1, 3, 5] });
await client.pdfRotate({ file: 'https://example.com/doc.pdf', angle: 90, pages: [2, 4] });

Error Handling

import {
  ConvertIntoMP4Client,
  ApiError,
  AuthenticationError,
  RateLimitError,
  TimeoutError,
} from 'convertintomp4';

try {
  const job = await client.getJob('invalid-id');
} catch (error) {
  if (error instanceof AuthenticationError) {
    console.error('Invalid API key');
  } else if (error instanceof RateLimitError) {
    console.error(`Rate limited. Retry after ${error.retryAfter}s`);
  } else if (error instanceof TimeoutError) {
    console.error('Request timed out');
  } else if (error instanceof ApiError) {
    console.error(`API error ${error.statusCode}: ${error.code} - ${error.message}`);
  }
}

TypeScript Support

Written in TypeScript with full type definitions for every request and response.

import type { Job, Task, Format, Webhook, CreateJobRequest } from 'convertintomp4';

Links

License

MIT