@kenyog/rtf-to-quill-delta

converter from rtf file to quill delta format.

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
@kenyog/rtf-to-quill-delta
Minified + gzip package size for @kenyog/rtf-to-quill-delta in KB

Readme

rtf-to-quill-delta

This is a Node.js module for converting rtf file into quill delta format.

Requirement

This modules depends on following modules.

Usage

sample program

const RtfToDeltaConverter = require('@kenyog/rtf-to-quill-delta');
async function main() {
  let rtf = await readFile('test.rtf', {encoding: 'ascii'});
  let converter = new RtfToDeltaConverter();
  let delta = await converter.convert(rtf);
  console.log(JSON.stringify(delta, null, 2));
}

Output

{
  "ops": [
    {
      "insert": "ai",
      "attributes": {
        "size": "8px",
        "color": "#000000"
      }
    },
    {
      "insert": "ueoaiu",
      "attributes": {
        "bold": true,
        "size": "10.6px",
        "color": "#000000"
      }
    },
    {
      "insert": "eo",
      "attributes": {
        "bold": false,
        "size": "8px",
        "color": "#000000"
      }
    },
    {
      "insert": "\n"
    }
  ]
}

Install

npm install @kenyog/rtf-to-quill-delta

Licence

MIT

Author

kenyog

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.