You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

pymupdf-node

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

pymupdf-node

PyMuPDF with JS

0.0.2
Source
npmnpm
Version published
Weekly downloads
80
1233.33%
Maintainers
1
Weekly downloads
 
Created
Source

pymupdf-node

PyMuPDF for Node JS

Getting Started

Install node modules

npm install

Trying

Import into your source code with:

import * as PyMuPDFNode from "pymupdf-node";

Wheels should be loaded into the pymupdf module with:

const pymupdf = await PyMuPDFNode.loadPyMuPDF("node_modules/pymupdf-node/pymupdf/pymupdf-1.26.0-cp312-abi3-pyodide_2024_0_wasm32.whl");

And if you need PyMuPDF4LLM, with:

const pymupdf4LLM = await PyMuPDFNode.loadPyMuPDF4LLM("node_modules/pymupdf-node/pymupdf/pymupdf4llm-0.0.24-py3-none-any.whl");

Open a document:

let doc = pymupdf.open("test.pdf");

Copy a page:

doc.copy_page(0);

Get document as markdown:

const md = pymupdf4LLM.to_markdown(doc, {
		page_chunks: false,
		write_images: false,
		ignore_images: true,
		image_path: "",
		extract_words: false,
		show_progress: false,
	});
console.log(md);

Full example:

import * as PyMuPDFNode from "pymupdf-node";

const pymupdf = await PyMuPDFNode.loadPyMuPDF("node_modules/pymupdf-node/pymupdf/pymupdf-1.26.0-cp312-abi3-pyodide_2024_0_wasm32.whl");
const pymupdf4LLM = await PyMuPDFNode.loadPyMuPDF4LLM("node_modules/pymupdf-node/pymupdf/pymupdf4llm-0.0.24-py3-none-any.whl");

let doc = pymupdf.open("test.pdf");
doc.copy_page(0);

const md = pymupdf4LLM.to_markdown(doc, {
		page_chunks: false,
		write_images: false,
		ignore_images: true,
		image_path: "",
		extract_words: false,
		show_progress: false,
	});
console.log(md);

Documentation

PyMuPDF Node is PyMuPDF for JavaScript environments, but just use the PyMuPDF Python API as if it was JavaScript, see the PyMuPDF API documentation.

Keywords

mupdf

FAQs

Package last updated on 23 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts