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

parsejet

v0.1.2

Published

Official ParseJet SDK for Node.js/Bun/Deno - Parse URLs, PDFs, YouTube transcripts, web pages, and images with ease

Downloads

323

Readme

ParseJet SDK

The official ParseJet SDK for Node.js, Bun, and Deno. Extract text from URLs, PDFs, YouTube videos, web pages, and images with a single API.

Installation

# npm
npm install parsejet

# pnpm
pnpm add parsejet

# yarn
yarn add parsejet

# bun
bun add parsejet

Requirements: Node.js 18+ (uses native fetch).

Quick Start

import { ParseJet } from "parsejet";

const client = new ParseJet({ apiKey: "pj_YOUR_KEY" });

const result = await client.parse.url("https://example.com");
console.log(result.title);
console.log(result.text);

Authentication

Pass your API key directly or set it as an environment variable:

// Option 1: Pass directly
const client = new ParseJet({ apiKey: "pj_YOUR_KEY" });

// Option 2: Environment variable (PARSEJET_API_KEY)
const client = new ParseJet();

API Reference

All parse methods return a ParseResult:

type ParseResult = {
  text: string;
  title: string;
  source_type: string;
  metadata: Record<string, any>;
};

client.parse.url(url, options?)

Parse any URL. ParseJet auto-detects the content type (web page, PDF, YouTube, etc.).

const result = await client.parse.url("https://example.com/report.pdf");
console.log(result.text);
console.log(result.source_type); // "pdf", "webpage", "youtube", etc.

With markdown output:

const result = await client.parse.url("https://example.com/article", {
  outputFormat: "markdown",
});

client.parse.file(buffer, filename, options?)

Parse a file from a Buffer or Uint8Array.

import fs from "fs";

const buffer = fs.readFileSync("report.pdf");
const result = await client.parse.file(buffer, "report.pdf");
console.log(result.text);

client.parse.filePath(path, options?)

Parse a file directly from a local path.

const result = await client.parse.filePath("/path/to/report.pdf");
console.log(result.text);

client.parse.youtube(url, options?)

Extract a YouTube video transcript.

const result = await client.parse.youtube(
  "https://youtube.com/watch?v=dQw4w9WgXcQ",
  { language: "en" }
);
console.log(result.text);

client.parse.webpage(url, options?)

Parse a web page and extract its content.

const result = await client.parse.webpage("https://example.com/article");
console.log(result.title);
console.log(result.text);

client.parse.ocr(buffer, filename, options?)

Perform OCR on an image.

import fs from "fs";

const image = fs.readFileSync("screenshot.png");
const result = await client.parse.ocr(image, "screenshot.png");
console.log(result.text);

Options

ParseOptions

Available on all methods:

| Option | Type | Description | | -------------- | ------------------------ | ---------------------- | | outputFormat | "text" | "markdown" | Output format |

YouTubeOptions

Additional options for client.parse.youtube():

| Option | Type | Description | | ---------- | -------- | ---------------------------------- | | language | string | Preferred transcript language code |

Error Handling

The SDK throws ParseJetError for API errors, which includes the HTTP status code and the error body.

import { ParseJet, ParseJetError } from "parsejet";

const client = new ParseJet();

try {
  const result = await client.parse.url("https://example.com");
} catch (error) {
  if (error instanceof ParseJetError) {
    console.error(`API error ${error.status}: ${error.message}`);
    console.error(error.body);
  } else {
    throw error;
  }
}

Configuration

const client = new ParseJet({
  apiKey: "pj_YOUR_KEY",       // API key (or set PARSEJET_API_KEY env var)
  baseUrl: "https://api.parsejet.com", // Custom base URL (optional)
});

Environment Variables

| Variable | Description | | ------------------ | ------------- | | PARSEJET_API_KEY | Your API key |

License

MIT