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

react-resume-parser

v0.1.2

Published

A lightweight React + Node library for parsing resumes (PDF/DOCX) into structured JSON.

Downloads

60

Readme

🧠 React Resume Parser

React Resume Parser is a lightweight React + Node.js library that parses resumes (PDF/DOCX) into structured JSON — ready for use in web apps, dashboards, or recruitment platforms.

It works in both the browser (client-side) and Node.js environments, supports React integration and keeps all text verbatim (no auto-corrections, no data loss).

DEMO: DEMO

GitHub: GitHub

DEMO CODEBASE: Link


🚀 Features

  • 🧾 Parse resumes (PDF/DOCX) to structured JSON
  • 🧠 Verbatim-first — never modifies or guesses user data
  • 💡 Detects sections, headings, and work experience blocks
  • ⚙️ Supports both browser and Node.js runtimes
  • 🧱 Provides a React dropzone component for instant UI integration
  • 🔍 Extracts metadata like email, phone, URLs, and role headings
  • 📄 Handles image-based PDFs (with optional OCR fallback, coming soon)
  • ⚡ Built with TypeScript — full typings & intellisense
  • 🧩 Works offline — no server calls, no API keys needed

📦 Installation

npm install react-resume-parser
# or
yarn add react-resume-parser

📝 Note:

To parse PDFs in the browser, make sure your bundler supports Web Workers and pdf.js. Most modern setups (Vite, Next.js, CRA) handle this automatically.

⚛️ Usage in React (Browser)

You can use the built-in component for easy file uploads and parsing:

import { useState } from "react";
import { ResumeDropzone } from "react-resume-parser/react";

export default function App() {
  const [result, setResult] = useState(null);

  return (
    <div style={{ maxWidth: 900, margin: "40px auto" }}>
      <h1>React Resume Parser</h1>
      <ResumeDropzone onResult={(data) => setResult(data)} />
    </div>
  );
}

OR

import { useState } from "react";
import { parseResume } from "react-resume-parser";

export default function App() {
  const [result, setResult] = useState<any>(null);
  const [status, setStatus] = useState<"idle" | "parsing" | "error">("idle");

    const handleParseFile = async (file: File) => {
        setStatus("parsing");
        setMessage("Parsing…");
        setResult(null);

        try {
            const res = await parseResume(file, { mode: "verbatim", source: "browser" });
            setResult(res);
            setStatus("idle");
            setMessage("");
        } catch (err: any) {
            setStatus("error");
            setMessage(err?.message || "An error occurred while parsing.");
        }
    };

    return ( 
     <div>
      <input
        type="file"
        accept=".pdf,.docx,.txt"
        onChange={(e) => {
          const file = e.target.files?.[0];
          if (file) handleParseFile(file);
        }}
      />
    </div>
    )
    }

💡 Example result

{
  "structured": {
    "basics": { "email": "[email protected]", "phone": "+234 806768567" },
    "sections": [
      { "heading": "PROFILE SUMMARY", "lines": ["Experienced full-stack developer...", "..."] },
      { "heading": "SKILLS AND COMPETENCIES", "lines": ["ReactJS", "Node.js", "TypeScript"] },
      { "heading": "PROFESSIONAL EXPERIENCE", "lines": ["Full-stack Developer | ProfitAll", "..."] }
    ],
    "work": [
      {
        "heading": "Full-stack Developer | example | May 2025 - Present",
        "bullets": [
          "● Built and maintained core features using Next.js and Node.js",
          "● Collaborated across design and product teams to deliver new features"
        ]
      }
    ]
  },
  "meta": { "parser": "pdf", "pages": 2, "version": "1.0.0" },
  "warnings": []
}

⚙️ Usage in Node.js / Backend

You can parse resumes directly from a file, buffer, or upload stream:

import { parseResume } from "react-resume-parser";
import fs from "fs";

(async () => {
  const file = fs.readFileSync("./resume.pdf");
  const result = await parseResume(file, { mode: "verbatim" });

  console.log(result.structured);
})();

Output example:

{
  "basics": {
    "email": "[email protected]",
    "phone": "+123 456 7890"
  },
  "sections": [
    { "heading": "EXPERIENCE", "lines": ["Software Engineer | ABC Corp | 2021 - Present", "..."] },
    { "heading": "EDUCATION", "lines": ["B.Sc. Computer Science | MIT | 2019"] }
  ]
}

🧠 Handling DOCX and PDF in Your Codebase

This package supports:

✅ .pdf files — powered by pdfjs-dist

✅ .docx files — powered by jszip and mammoth

⚠️ Important: Older .doc files (Word 97–2003 binary format) are not supported. Please convert them to .docx or .pdf before parsing.

Ensure your bundler or environment supports these libraries:

  • pdfjs-dist — requires Web Worker support (already handled by Vite, Next.js, etc.)

  • jszip — works client- and server-side, no configuration needed

  • mammoth — best used in Node.js (browser fallback is automatically handled)

🧰 Example: Detect Non-Resume Files

By default, the parser warns if the file doesn’t look like a resume:

{
  "warnings": [
    {
      "code": "NOT_RESUME",
      "message": "This file does not appear to be a resume (missing key sections like Experience/Education/Skills)."
    }
  ]
}

You can disable that check:

await parseResume(file, { checkResumeType: false });

🧩 API Exports

| Export | Description | | ---------------- | --------------------------------------------------- | | parseResume() | Core function — parses files to structured JSON | | ResumeDropzone | React component for drag-and-drop parsing | | resume.worker | Web Worker file used internally for browser parsing |

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.

Before committing, make sure to run:

npm run build

🧾 License

MIT © Victor Obije

❤️ Made for developers who want clean, structured resume data — fast.