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.0.0

Published

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

Readme

@convertintomp4/sdk

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

Installation

npm install @convertintomp4/sdk

Requirements

  • Node.js 18+ (uses native fetch API)

Quick Start

import { ConvertIntoMP4Client } from '@convertintomp4/sdk';

const client = new ConvertIntoMP4Client({
  apiKey: 'your-api-key',
});

// Quick convert a file
const fs = await import('fs');
const file = new Blob([fs.readFileSync('video.mp4')]);
const result = await client.convert(file, 'webm');
console.log('Job ID:', result.jobId);

Configuration

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

Usage

Job-Based Conversion

Create multi-step conversion jobs with task pipelines:

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

// Wait for completion
const completed = await client.waitForJob(job.id, {
  interval: 2000,
  timeout: 120000,
});

console.log('Status:', completed.status);

Quick Convert (File Upload)

import { readFileSync } from 'fs';

const file = new Blob([readFileSync('input.mp4')]);
const result = await client.convert(file, 'webm', {
  quality: 'high',
  resolution: '720p',
});

Import from URL

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

List and Manage Jobs

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

// Get job details
const job = await client.getJob('job_abc123');

// Delete a job
await client.deleteJob('job_abc123');

// Cancel a running job
await client.cancelJob('job_abc123');

// Retry a failed job
await client.retryJob('job_abc123');

Download Converted File

const response = await client.downloadFile('job_abc123');
const buffer = Buffer.from(await response.arrayBuffer());
fs.writeFileSync('output.webm', buffer);

Formats

// List all formats
const formats = await client.listFormats();

// Filter by category
const videoFormats = await client.listFormats('video');

// Get conversion options
const options = await client.getFormatOptions('mp4', 'webm');

Webhooks

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

// List webhooks
const webhooks = await client.listWebhooks();

// Delete a webhook
await client.deleteWebhook(webhook.id);

PDF Operations

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

// Split PDF
const parts = await client.pdfSplit({
  file: 'https://example.com/doc.pdf',
  ranges: ['1-3', '4-6'],
});

// Merge PDFs
const merged = await client.pdfMerge({
  files: [
    'https://example.com/doc1.pdf',
    'https://example.com/doc2.pdf',
  ],
});

// Encrypt PDF
await client.pdfEncrypt({
  file: 'https://example.com/doc.pdf',
  password: 'secure123',
  permissions: { printing: true, copying: false },
});

// Compress PDF
await client.pdfCompress({ file: 'https://example.com/doc.pdf' });

// Add watermark
await client.pdfWatermark({
  file: 'https://example.com/doc.pdf',
  text: 'CONFIDENTIAL',
  opacity: 0.3,
});

// Extract pages
await client.pdfExtractPages({
  file: 'https://example.com/doc.pdf',
  pages: [1, 3, 5],
});

// Rotate pages
await client.pdfRotate({
  file: 'https://example.com/doc.pdf',
  angle: 90,
  pages: [2, 4],
});

Error Handling

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

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

This SDK is written in TypeScript and provides full type definitions. All request parameters and response types are fully typed.

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

License

MIT