import * as fs from 'fs'; import * as iconvLite from 'iconv-lite'; import { Tokenize, DeEncapsulate } from 'rtf-stream-parser'; const input = fs.createReadStream('encapsulated.rtf'); const output = fs.createWrit
import*asfsfrom'fs';import*asiconvLitefrom'iconv-lite';import{Tokenize,DeEncapsulate}from'rtf-stream-parser';constinput=fs.createReadStream('encapsulated.rtf');constoutput=fs.createWriteStream('output.html');input.pipe(newTokenize()).pipe(newDeEncapsulate({decode:iconvLite.decodemode:'either'})...
This is a general RTF parser. It takes an text stream and produces a document object representing the parsed document. In and of itself, this isn't super useful but it's the building block for other tools to convert RTF into other formats. - iarna/rtf-