
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
@file-type/pdf
Advanced tools
Detector plugin for file-type that identifies PDF (Portable Document Format) files and selected PDF-based subtypes.
This plugin goes beyond simple magic-number detection and can inspect the internal PDF structure to distinguish between generic PDF files and specific producer formats such as Adobe Illustrator (.ai).
This detector is designed for well-formed PDF files and established PDF-based subtypes. Support for corrupted or non-conforming PDFs is intentionally limited and only considered when a deviation is both common and widely accepted.
npm install @file-type/pdf
The following example shows how to add the PDF detector to file-type:
import { FileTypeParser } from 'file-type';
import { detectPdf } from '@file-type/pdf';
const parser = new FileTypeParser({
customDetectors: [detectPdf],
});
const fileType = await parser.fromFile('example.pdf');
console.log(fileType);
.ai / application/illustrator: Adobe Illustrator.pdf / application/pdf: Generic Portable Document Format filesThis project is licensed under the MIT License. Feel free to use, modify, and distribute it as needed.
FAQs
file-type plugin to parse PDF files
We found that @file-type/pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.