bionic-converter
v1.0.3
Published
Convert text to Bionic Reading format
Downloads
3
Readme
Bionic-converter
function bionicConvert(str: string, fixationLength?: number, separator?: string[] | string): string
Getting started
const bionicConvert = require('bionic-converter')
console.log(bionicConvert("Lorem ipsum dolor sit amet"))
>> `<b>Lor</b>em <b>ips</b>um <b>dol</b>or <b>s</b>it <b>am</b>et`
Fixation point
// Set fixation point from 1 - 5 (default 3)
bionicConvert("Lorem ipsum dolor sit amet.", 1)
Separator
// "latex", "markdown", "html", or array ["<b>","</b>"]
bionicConvert("Lorem ipsum dolor sit amet.", 3, "latex")
>> \textbf{lor}em \textbf{ips}um \textbf{dol}or \textbf{si}t \textbf{ame}t
bionicConvert("Lorem ipsum dolor sit amet.", 3, ["(", ")"])
>> (Lor)em (ips)um (dol)or (s)it (am)et.