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

image2ppt

v0.1.1

Published

Official Node.js/TypeScript client for the image2ppt API — convert images and PDFs into editable PowerPoint (.pptx).

Readme

image2ppt — Node.js / TypeScript client

Official Node.js client for the image2ppt API. Turn a batch of images or PDF pages into one editable PowerPoint (.pptx).

Zero runtime dependencies — uses the built-in fetch / FormData (Node 18+).

Install

npm install image2ppt

Fully typed. Works from JavaScript or TypeScript, ESM or CommonJS interop.

Get an API key

Sign in at image2ppt.com, open Developer / API from the account menu, and create a key (looks like i2p_live_xxxx). It's shown in full once — save it. API access is available to accounts with credits.

Server-side only. This SDK reads files from disk and holds your API key — run it on your backend, never in a browser or any client a user can inspect.

Quick start

One shot — submit, wait, download:

import { Image2PPTClient } from "image2ppt";

const client = new Image2PPTClient({ apiKey: process.env.IMAGE2PPT_API_KEY! });

const job = await client.convert(
  ["slide1.png", "slide2.png", "report.pdf"],
  "out.pptx",
  { locale: "zh-CN", aspectRatio: "16:9" }, // both optional
);
console.log(`done — ${job.slideCount} pages, ${job.creditsUsed} credits used`);

Step by step, if you want to control polling:

const job = await client.submit(["slide1.png"], { aspectRatio: "4:3" });
console.log("job:", job.jobId, "reserved:", job.creditsReserved);

const done = await client.wait(job.jobId, { pollIntervalMs: 5000, timeoutMs: 1_800_000 });
await client.download(done.jobId, "out.pptx");

Check your balance:

const { email, credits } = await client.account();
console.log(email, "credits:", credits);

How it works

  • Async. submit resolves with a job id immediately; conversion runs in the background. A single page typically takes ~2 minutes; 90% of jobs finish within 3.
  • One job = one PPTX. All files in a submission are merged into a single deck, in upload order.
  • Billed per page. 1 page = 1 credit, reserved at submit and settled on completion. If some pages fail but others succeed, the job still completes with the good pages and the failed pages' credits are refunded (creditsRefunded).
  • Limits. Each file ≤ 35MB; total ≤ 50 pages per job (images count as 1, PDFs as their page count).
  • Time units. pollIntervalMs and timeoutMs are in milliseconds (idiomatic for Node's timers).

The Node SDK uploads files as-is; the server compresses them. (The Python SDK additionally pre-compresses images client-side to save bandwidth — a future addition here.)

Rate limits

Per account (all keys share the budget): ≤ 10 concurrent jobs, ≤ 60 pages/minute submitted. Over the limit returns 429 with a Retry-After hint. wait() handles 429 backoff for you automatically. If you call submit() directly, catch RateLimitedError and honor retryAfter (seconds):

import { RateLimitedError } from "image2ppt";

for (;;) {
  try {
    job = await client.submit(paths);
    break;
  } catch (e) {
    if (e instanceof RateLimitedError) {
      await new Promise((r) => setTimeout(r, (e.retryAfter ?? 5) * 1000));
    } else throw e;
  }
}

Errors

Every error subclasses Image2PPTError and carries statusCode, code, and message. Branch on code, not message.

| Class | HTTP | code | |---|---|---| | AuthenticationError | 401 / 403 | INVALID_API_KEY, API_KEY_REQUIRED, ACCOUNT_DELETED | | InvalidFileError | 400 | INVALID_FILE | | TooManySlidesError | 400 | TOO_MANY_SLIDES | | InsufficientCreditsError | 402 | INSUFFICIENT_CREDITS | | RateLimitedError | 429 | RATE_LIMITED (has retryAfter) | | JobNotFoundError | 404 | JOB_NOT_FOUND | | NotReadyError | 409 | NOT_READY | | OutputExpiredError | 410 | OUTPUT_EXPIRED | | JobFailedError | — | job's error.code (thrown by wait(); .job is the snapshot) | | Image2PPTTimeoutError | — | — (wait() exceeded its timeoutMs; job may still be running) |

import { Image2PPTError, JobFailedError } from "image2ppt";

try {
  await client.convert(paths, "out.pptx");
} catch (e) {
  if (e instanceof JobFailedError) console.error("failed:", e.code, e.message);
  else if (e instanceof Image2PPTError) console.error("request error:", e.statusCode, e.code);
  else throw e;
}

Full API reference

See ../docs/api.md for the complete HTTP contract (endpoints, fields, error codes). 中文版:../docs/api.zh.md

Develop

npm install
npm run build   # tsc -> dist/
npm test        # vitest

License

MIT