Simple string formatter for cleaning up clinical trial parsed data from CTGOV (ClinicalTrials.gov). Removes unnecessary carriage returns and line breaks to produce display-friendly strings for web and mobile pages. Version 1.0.2, stable. Uses regex and standard string functions. Differentiator: focused solely on formatting CTGOV OCR output.
npm install ctgov-ocr-formatterNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to instantiate Formatter and call formatData to clean up a textblock from CTGOV data.
Ensure argument is a string (e.g., from textblock[0]) before calling formatData.
Create a declaration file (ctgov-ocr-formatter.d.ts) with: declare module 'ctgov-ocr-formatter' { export class Formatter { formatData(data: string): string; } }Use formatData only for removing extraneous carriage returns; if you need to keep specific formatting, preprocess the string.
Use import { Formatter } from 'ctgov-ocr-formatter' or const { Formatter } = require('ctgov-ocr-formatter').Run 'npm install ctgov-ocr-formatter' and verify package.json includes it.
Ensure you are using new Formatter() (with new) and the import is correct.
No dependency data recorded yet.