Inserts a string before a needle's start in a haystack.
npm install --save insert-string-before@^1.0.1yarn add insert-string-before@^1.0.1
(if configured properly)
npm install --save @jaid/insert-string-before@^1.0.1import insertStringBefore from "insert-string-before"
const result = insertStringBefore("I am the Hedgehog!", "the", "Sanic ")Variable result will be:
"I am Sanic the Hedgehog!"Setting up:
git clone git@github.com:jaid/insert-string-before.git
cd insert-string-before
npm installTesting:
npm run test:devTesting in production environment:
npm run testMIT License
Copyright © 2020, Jaid <jaid.jsx@gmail.com> (github.com/jaid)