Support for all languages with Space-separated words.
An Open-Source JavaScript Implementation of Bionic Reading API.
npm i bionic-reading
yarn add bionic-reading
pnpm add bionic-reading
import { bionicReading } from 'bionic-reading';
const text =
'Bionic Reading is a new method facilitating the reading process by guiding the eyes through text with artificial fixation points. As a result, the reader is only focusing on the highlighted initial letters and lets the brain center complete the word. In a digital world dominated by shallow forms of reading, Bionic Reading aims to encourage a more in-depth reading and understanding of written content.';
const bionicText = bionicReading(text);
console.log(bionicText); // '<b>Bion</b>ic <b>Readi</b>ng ... <b>writt</b>en <b>conte</b>nt.'
const { bionicReading } = require('bionic-reading');
const text =
'Bionic Reading is a new method facilitating the reading process by guiding the eyes through text with artificial fixation points. As a result, the reader is only focusing on the highlighted initial letters and lets the brain center complete the word. In a digital world dominated by shallow forms of reading, Bionic Reading aims to encourage a more in-depth reading and understanding of written content.';
const bionicText = bionicReading(text);
console.log(bionicText); // '<b>Bion</b>ic <b>Readi</b>ng ... <b>writt</b>en <b>conte</b>nt.'
bionicReading('bionic-reading'); // '<b>bion</b>ic-<b>readi</b>ng'
type Options = Partial<{
highlightTag: string;
markdown: boolean;
markdownStyle: string;
}>;
- Default Value:
'b'
// default highlight tag: `<b>`
bionicReading('bionic-reading'); // '<b>bion</b>ic-<b>readi</b>ng'
// changed highlight tag: `<strong>`
bionicReading('bionic-reading', { highlightTag: 'strong' }); // '<strong>bion</strong>ic-<strong>readi</strong>ng'
- Default Value:
false
bionicReading('bionic-reading', { markdown: true, highlightTag: 'strong' }); // '**bion**ic-**readi**ng'
If true, the highlightTag
option is ignored.
- Default Value:
'**'
bionicReading('bionic-reading', { markdown: true, markdownStyle: '__' }); // '__bion__ic-__readi__ng'
If the markdown
option is false, this option is ignored.
MIT @Gumball12