JSPM

bionic-converter

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4
  • Score
    100M100P100Q17701F
  • License MIT

Convert text to Bionic Reading format

Package Exports

  • bionic-converter
  • bionic-converter/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bionic-converter) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

npm version

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.