@zalko/linkedin-parser
v1.0.1
Published
LinkedIn resume PDF parser with comprehensive Jest testing and test data generation
Downloads
28
Maintainers
Readme
@zalko/linkedin-parser
A clean, lightweight TypeScript library for parsing LinkedIn PDF resumes and extracting structured profile data.
Installation • Quick Start • API Reference • Examples
✨ Features
📦 Installation
npm install @zalko/linkedin-parseryarn add @zalko/linkedin-parserpnpm add @zalko/linkedin-parser🚀 Quick Start
import { parseLinkedInPDF } from '@zalko/linkedin-parser';
import fs from 'fs';
// Parse from PDF Buffer
const pdfBuffer = fs.readFileSync('resume.pdf');
const result = await parseLinkedInPDF(pdfBuffer);
console.log(result.profile.name); // "John Silva"
console.log(result.profile.contact.email); // "[email protected]"
console.log(result.profile.experience); // [{ title: "...", company: "..." }]📚 Examples
Basic Usage
import { parseLinkedInPDF } from '@zalko/linkedin-parser';
const pdfBuffer = fs.readFileSync('linkedin-resume.pdf');
const { profile } = await parseLinkedInPDF(pdfBuffer);
// Access parsed data
console.log(`Name: ${profile.name}`);
console.log(`Email: ${profile.contact.email}`);
console.log(`Skills: ${profile.top_skills.join(', ')}`);
console.log(`Experience: ${profile.experience.length} positions`);With Options
// Include raw extracted text in result
const result = await parseLinkedInPDF(pdfBuffer, {
includeRawText: true
});
console.log(`Raw text: ${result.rawText?.substring(0, 100)}...`);Parse Text Directly
// If you already have extracted text from PDF
const extractedText = "John Silva\nSoftware Engineer...";
const result = await parseLinkedInPDF(extractedText);Error Handling
try {
const result = await parseLinkedInPDF(pdfBuffer);
console.log(result.profile);
} catch (error) {
if (error.message === 'PDF appears to be empty or unreadable') {
console.error('Invalid PDF file');
} else {
console.error('Parsing failed:', error.message);
}
}📖 API Reference
parseLinkedInPDF(input, options?)
Parses a LinkedIn PDF resume and extracts structured profile data.
Parameters
| Parameter | Type | Description |
|-----------|------|-------------|
| input | Buffer \| string | PDF Buffer or extracted text string |
| options? | ParseOptions | Optional parsing configuration |
Returns
Promise<ParseResult> - Promise resolving to parsed profile data
Example
const result = await parseLinkedInPDF(pdfBuffer, { includeRawText: true });🏗️ TypeScript Interfaces
interface LinkedInProfile {
name: string;
headline: string;
location: string;
contact: Contact;
top_skills: string[];
languages: Language[];
summary?: string;
experience: Experience[];
education: Education[];
}interface Contact {
email: string;
phone?: string;
linkedin_url?: string;
location?: string;
}interface Experience {
title: string;
company: string;
duration: string;
location?: string;
description?: string;
}interface Education {
degree: string;
institution: string;
year?: string;
location?: string;
description?: string;
}interface Language {
language: string;
proficiency: string;
}interface ParseOptions {
includeRawText?: boolean;
}interface ParseResult {
profile: LinkedInProfile;
rawText?: string;
}🛠️ Development
# Clone repository
git clone https://github.com/zalkowitsch/linkedin-parser.git
cd linkedin-parser
# Install dependencies
npm install
# Run tests
npm test
# Build library
npm run build
# Run tests with coverage
npm run test:coverage
# Clean build artifacts
npm run clean📊 Performance
- Processing time: ~62ms average for typical LinkedIn PDF
- Memory usage: Minimal memory footprint (~6MB)
- Bundle size: Lightweight with only essential dependencies
🛡️ Quality & Trust
🌍 Compatibility
Supported Environments:
- ✅ Node.js 16+ (ES2022 support)
- ✅ TypeScript 5.0+
- ✅ ESM (ES Modules)
- ✅ CommonJS (via build)
- ✅ Browsers (via bundlers)
Package Managers:
- ✅ npm 8+
- ✅ yarn 1.22+
- ✅ pnpm 7+
🤝 Contributing
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
📄 License
⭐ Star this project if you find it helpful!
Made with ❤️ by Arkady Zalkowitsch
