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

@xberg-io/langchain-xberg

v1.0.14

Published

LangChain.js document loader for Xberg — extract text, tables, and metadata from 101 document formats with optional OCR.

Readme

@xberg-io/langchain-xberg

npm

A LangChain.js document loader for Xberg. Point it at a file, a directory, or raw bytes and it returns LangChain Documents with the extracted text, tables, and rich metadata from 101 document formats — with optional OCR for scans and images.

Extraction runs locally in-process through the @xberg-io/xberg native binding. No API key, no cloud call, no data leaves your machine.

Installation

@langchain/core is a peer dependency — install it alongside the loader:

npm install @xberg-io/langchain-xberg @langchain/core

Node.js 20.15+ is required on a platform for which @xberg-io/xberg ships a prebuilt binary (Linux x64/arm64 glibc or musl, macOS arm64, Windows x64/arm64).

Quick start

import { XbergLoader } from "@xberg-io/langchain-xberg";

// Single file — one Document
const loader = new XbergLoader({ filePath: "report.pdf" });
const docs = await loader.load();
console.log(docs[0].pageContent, docs[0].metadata);

// Multiple files or a directory — one batched extraction
const many = new XbergLoader({ filePath: "./docs", glob: "**/*.pdf" });

// Raw bytes — mimeType is required
const bytes = new XbergLoader({ data: fileBytes, mimeType: "application/pdf" });

One Document per chunk (retrieval)

Enable chunking on the ExtractionConfig to emit one Document per chunk, each carrying heading path, page span, and token-count metadata ready to embed:

const loader = new XbergLoader({
  filePath: "report.pdf",
  config: { chunking: { max_chars: 1000, max_overlap: 200 } },
});
const chunks = await loader.load();

One Document per page

const loader = new XbergLoader({
  filePath: "report.pdf",
  config: { pages: { extractPages: true } },
});
const pages = await loader.load(); // metadata.page is 0-indexed

Supported formats

Xberg extracts from 101 formats including PDF, DOCX, PPTX, XLSX, HTML, EPUB, images, and more. See the Xberg documentation for the full list and the extraction configuration reference.

Part of Xberg.io

  • Xberg — document intelligence: text, tables, metadata from 101 formats with optional OCR.
  • Xberg Enterprise — managed extraction API with SDKs, dashboards, and observability.

License

MIT