Hides some words from a blob of text

Usage no npm install needed!

<script type="module">
  import hideSomeWords from 'https://cdn.skypack.dev/hide-some-words';



npm version travis PRs Welcome code style: prettier License: MIT

Hides some words from a blob of text. For input foo bar test example it may return foo bar ___ example.


const hideSomeWords = require("hide-some-words");

const text = 
`Lorem ipsum dolor sit amet, consectetur adipiscing elit.Proin eget erat urna.
Donec vel dui vel felis efficitur posuere vitae nec massa. Nullam auctor
porttitor ligula, eget consequat sem hendrerit ac. Nam tristique aliquet sapien,
vel tincidunt urna mattis porttitor. Quisque ullamcorper eu lectus vitae luctus.`;


consistently prints:

_____ ipsum dolor ___ amet, ___________ adipiscing ____.Proin ____ ____ urna.
Donec ___ dui vel felis efficitur posuere _____ nec _____. Nullam ______
_________ ______, eget consequat ___ _________ ac. ___ tristique _______ sapien,
vel _________ urna mattis porttitor. _______ ullamcorper eu lectus vitae luctus.


Name Type Default Description
text string The input text
percentage number 0.3 A percentage between 0.0 to 1.0 which determines the amount of (hideable) words to hide
character string _ The replacement character
skipLength number 2 The length that a word needs to have in order to skip it