• Stars
    star
    243
  • Rank 166,489 (Top 4 %)
  • Language
    TypeScript
  • License
    MIT License
  • Created over 2 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An Open-Source JavaScript Implementation of Bionic Reading.

TextVide (vide; Latin for "see")

npm bundle size npm downloads jsDelivr hits (npm) GitHub package.json version (subfolder of monorepo) changelog

ci codecov

logo

Support all languages that separate words with spaces

Try on Runkit or Online Sandbox

This module is an open source implementation that mimics the behavior of the Bionic Reading API.

It does not require any additional licenses, except for MIT. (#38)

πŸ’« Features

Feature State
Support all languages βœ…
Support ESM and CommonJS βœ…
Custom sep Style βœ…
Fixation-Points βœ…
Ignore HTML Tags βœ…
Saccade ❌

Benchmark

Sun Aug 07 2022 01:33:40 GM +0900
length of normal text: 590
length of text with html tags: 1579

normal#ignoreHtmlTags x 46,106 ops/sec Β±4.22% (86 runs sampled)
normal#notIgnoreHtmlTags x 53,200 ops/sec Β±0.93% (89 runs sampled)
withHtmlTags#ignoreHtmlTags x 3,213 ops/sec Β±0.92% (87 runs sampled)
withHtmlTags#notIgnoreHtmlTags x 3,605 ops/sec Β±1.59% (87 runs sampled)

code

βš™οΈ Install

npm i text-vide
yarn add text-vide
pnpm add text-vide

CDN

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.iife.js"></script>

πŸ“– Usage

Browser

<script src="https://cdn.jsdelivr.net/npm/text-vide/dist/index.iife.js"></script>
<script>
  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 highlightedText = textVide.textVide(text);

  console.log(highlightedText); // '<b>Bion</b>ic <b>Readi</b>ng ... <b>writt</b>en <b>conte</b>nt.'
</script>

ESM

import { textVide } from 'text-vide';

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 highlightedText = textVide(text);

console.log(highlightedText); // '<b>Bion</b>ic <b>Readi</b>ng ... <b>writt</b>en <b>conte</b>nt.'

CommonJS

const { textVide } = require('text-vide');

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 highlightedText = textVide(text);

console.log(highlightedText); // '<b>Bion</b>ic <b>Readi</b>ng ... <b>writt</b>en <b>conte</b>nt.'

πŸ“š API

textVide(text: string, options?: Options)

textVide('text-vide');
textVide('text-vide', {
  // ... Options
});

Options

type Options = Partial<{
  sep: string | string[];
  fixationPoint: number;
  ignoreHtmlTag: boolean;
}>;

sep

  • Default Value: ['<b>', '</b>']

Passing a string allows you to specify the Beginning and End of the highlighted word at once.

textVide('text-vide', { sep: '**' }); // '**tex**t-**vid**e'

It can also set them up by passing a list of length 2.

textVide('text-vide', { sep: ['<strong>', '</strong>'] }); // '<strong>tex</strong>t-<strong>vid</strong>e'

fixationPoint

  • Default Value: 1
  • Range: [1, 5]
// Default fixation-point: 1
textVide('text-vide'); // '<b>tex</b>t-<b>vid</b>e'

// Changed fixation-point: 5
textVide('text-vide', { fixationPoint: 5 }); // '<b>t</b>ext-<b>v</b>ide'

ignoreHtmlTag

  • Default Value: true

If this option is true, HTML tags are not highlighted.

textVite('<div>abcd</div>efg'); // '<div><b>abc</b>d</div><b>ef</b>g'
textVite('<div>abcd</div>efg', { ignoreHtmlTag: false }); // '<<b>di</b>v><b>abc</b>d</<b>di</b>v><b>ef</b>g'

License

MIT @Gumball12

It does not require any additional licenses, except for MIT. (#38)

More Repositories

1

mvvm-in-js

simplest mvvm application example with vanilla js
JavaScript
10
star
2

kakao-payment-test

πŸ’» Create Kakao payment (KakaoPay) FaaS via AWS Serverless
JavaScript
10
star
3

google-spreadsheet-dts

[WIP] Validate Google Spreadsheet at compile time πŸ‘Œ
TypeScript
10
star
4

cat-explorer

ν”„λ‘œκ·Έλž˜λ¨ΈμŠ€ 2021 μƒλ°˜κΈ° ν”„λ‘ νŠΈμ—”λ“œ Dev-Matching 과제 볡기 : 고양이 탐색기 λ§Œλ“€κΈ°
JavaScript
8
star
5

ts-rollup-npm-vite-boilerplate

Boilerplate for building a TypeScript + Rollup + Vite module that can be published to NPM.
JavaScript
7
star
6

vitest-vue-demi-pnpm-monorepo

Vitest + VueDemi + PNPM Workspace w/ Turborepo
TypeScript
6
star
7

lmsplusplus

πŸ”§ 사이버 κ°•μ˜ 크둬 ν™•μž₯ ν”„λ‘œκ·Έλž¨
JavaScript
4
star
8

fruition-with-comments

Fruition with Comments πŸ’¬πŸ’¬πŸ’¬ (using Giscus)
Vue
4
star
9

web-component-tutorial-codes

λͺ¨λ˜ μ›Ή μ»΄ν¬λ„ŒνŠΈ νŠœν† λ¦¬μ–Ό μ½”λ“œ (https://shj.rip/Web-Component-87086dac49d4411697676a85b44cc458)
HTML
4
star
10

pinia-plugin-watch

[WIP] 🍍 The easiest way to watch for your Pinia State.
TypeScript
4
star
11

get-bezier-curve

online bezier curve tool
JavaScript
4
star
12

orthos-paper

paper that petition analysis system
TeX
3
star
13

byte-converter

βœ‚οΈ Byte converter implemented by C lang (random int, double, char, string => byte)
C
3
star
14

tech-interview-quiz

μ§ˆλ¬Έμ„ 톡해 기술 면접을 μ€€λΉ„ν•΄λ΄μš”
Vue
3
star
15

oopsla-static-webpage

μ•ˆλ…•ν•˜μ„Έμš”. 옡슬라 연ꡬ싀 ν™ˆνŽ˜μ΄μ§€ λ¦¬ν¬μ§€ν† λ¦¬μž…λ‹ˆλ‹€.
3
star
16

dokidoki-exhibition

@studio_dokidoki
Vue
2
star
17

pinia-plugin-on-mounted

[Deprecated] 🍍 Mounted hook in Pinia.
TypeScript
1
star
18

vanilla-trello

implement an app like in trello using vanilla js
JavaScript
1
star
19

tech-interview-quiz-items

μ§ˆλ¬Έμ„ 톡해 기술 면접을 μ€€λΉ„ν•΄λ΄μš”
1
star
20

valpi

api that returns value
JavaScript
1
star
21

touch-ato

ν„°μΉ˜μ•„ν† 
JavaScript
1
star
22

malicious-url-detection

Jupyter Notebook
1
star