droptheword
v1.0.2
Published
Avoid leaving conjunctions alone. Make your website look even better with DropTheWord! Go to https://github.com/OkePoland/DropTheWord#readme for more information
Readme
DropTheWord
Install
npm install dropthewordDemo
https://pedantic-benz-27df81.netlify.com/
Usage
import { replaceSpacesInString, replaceSpacesInCssSelector } from "droptheword";Usage with strings
Function will transform provided string to string with "hard spaces" after each word provided in an array.
const myOldString =
"Lorem Ipsum is simply dummy text of the printing and typesetting industry.";
const wordsToDrop = ["is", "of", "and", "the"];
const myNewString = replaceScacesInString({
text: myOldString,
dropWordList: wordsToDrop
});Usage with CSS selector
Function will search the page for css selector occurrences and it will transform text content of it to string with hard spaces.
const myCssSelector = "[data-text=my-paragraphs]";
const wordsToDrop = ["is", "of", "and", "the", "no"];
replaceSpacesInCssSelector({
cssSelector: myCssSelector,
dropWordList: wordsToDrop
});