tma-extractor
v0.0.1
Published
Framework-independent JavaScript/TypeScript package for extracting TMA data from PDF files
Maintainers
Readme
TMA Extractor
A framework-independent JavaScript/TypeScript package for extracting TMA (Talents Mapping) data from PDF files.
Installation
npm install tma-extractor pdfjs-distUsage
import tmaExtractor from 'tma-extractor';
// Extract TMA data from a PDF file
const result = await tmaExtractor(pdfFile, {
includeSCM: false, // Set to true to include SCM extraction (requires tesseract.js)
workerSrc: '/path/to/pdf.worker.min.mjs', // Optional PDF.js worker path
debug: false // Enable debug logging
});
console.log(result.person.talents); // Array of 34 talents
console.log(result.person.strength); // Strength data
console.log(result.person.typology); // 30 typologies with scores
console.log(result.person.personalbranding); // Personal branding dataFeatures
- Framework Independent: Works with any JavaScript framework or vanilla JS
- Multi-format Support: Supports TMA PDF formats (49, 54, 46, 6 pages)
- TypeScript Support: Full type definitions included
- SCM Extraction: Optional SCM (Strength Cluster Map) extraction with OCR
- Clean API: Simple single function with optional configuration
API Reference
tmaExtractor(file, options?)
Extracts TMA data from a PDF file.
Parameters:
file: File- PDF file to extract data fromoptions?: TmaExtractorConfig- Optional configuration
Returns: Promise<TmaExtractorResult>
Configuration Options
interface TmaExtractorConfig {
includeSCM?: boolean; // Include SCM extraction (default: false)
workerSrc?: string; // Custom PDF.js worker path
tesseractWorkerSrc?: string; // Custom Tesseract worker path
debug?: boolean; // Enable debug logging (default: false)
timeoutMs?: number; // Extraction timeout (default: 30000)
}License
MIT
