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

flense

v0.0.7

Published

Convert PDF, DOCX, images to markdown. Document parsing SDK with OCR, table extraction, and real-time progress.

Readme

Flense

TypeScript/JavaScript client for the Flense document parsing API. Convert PDFs, images, and documents to markdown.

Flense is a paid document parsing service. Get a free demo API key to try it out.

npm install flense

Quick Start

import { Flense } from 'flense';

const flense = new Flense({ apiKey: 'flense_...' });

// Parse a PDF from URL
const result = await flense.parseUrl('https://example.com/doc.pdf').wait();
console.log(result.markdown);

// Parse a local file
import fs from 'fs';
const file = fs.readFileSync('document.pdf');
const result = await flense.parseFile(file, 'document.pdf').wait();
console.log(result.markdown);

Parse Options

All features are OFF by default for fastest processing. Enable them as needed:

const result = await flense
  .parseFile(file, 'document.pdf')
  .withOCR()       // Enable OCR for scanned documents
  .withTables()    // Enable table structure detection
  .withImages()    // Enable image extraction
  .withPageStreaming()  // Stream markdown per-page as each completes
  .wait();

| Method | Description | |--------|-------------| | .withOCR(enabled?) | Enable OCR for scanned/image-based PDFs | | .withTables(enabled?) | Enable table structure detection | | .withImages(enabled?) | Enable image extraction and upload | | .withPageStreaming(enabled?) | Stream markdown per-page as each page completes | | .disableCaching() | Skip cache and force a fresh parse |

Caching

File parse results are cached automatically. When the same file is uploaded with the same options, the cached result is returned instantly with no re-processing. The cache key is a SHA-256 hash of the file content and the parse options.

// Caching is ON by default — identical files return instantly
const result = await flense.parseFile(file, 'doc.pdf').wait();

// Force a fresh parse
const fresh = await flense.parseFile(file, 'doc.pdf').disableCaching().wait();

Caching only applies to parseFile(). URL parsing (parseUrl()) always fetches fresh content since the URL's content may change.

Real-time Progress

For large documents, subscribe to real-time updates:

const job = flense.parseFile(file, 'document.pdf');

job.subscribe({
  onProgress: ({ progress, stage, currentPage, totalPages }) => {
    console.log(`${progress}% - ${stage}`);
  },
  onContent: ({ page, content }) => {
    console.log(`Page ${page} ready`);
  },
  onComplete: (status) => {
    console.log('Done!', status.output?.markdown);
  },
  onError: (error) => {
    console.error('Failed:', error.message);
  },
});

React Hook

import { useParseJob } from 'flense/react';

function DocumentParser() {
  const { parseFile, progress, content, isProcessing, isComplete } = useParseJob({
    apiKey: 'flense_...',
  });

  return (
    <div>
      <input
        type="file"
        onChange={(e) => {
          const file = e.target.files?.[0];
          if (file) parseFile(file);
        }}
      />
      {isProcessing && <p>Processing: {progress?.progress}%</p>}
      {isComplete && <pre>{content}</pre>}
    </div>
  );
}

Environment Variable

Set FLENSE_API_KEY to avoid passing the key explicitly:

export FLENSE_API_KEY=flense_your_key_here
const flense = new Flense(); // API key read from environment

Supported Formats

| Format | Type | |--------|------| | PDF | Documents | | DOCX | Word | | PPTX | PowerPoint | | XLS/XLSX | Excel | | CSV | Spreadsheets | | PNG, JPG, WEBP | Images |

API Reference

See the full API documentation at api.flense.dev/docs

License

MIT