A predicate function which, if returns true causes the current item to be operated on.
[...replaceWith]
any
If not specified, each found value will be removed. If specified, each found value will be replaced with this value. If the replaceWith value is a function, it will be invoked with the found value and its result used as the replace value. If the replaceWith function returns an array, the found value will be replaced with each item in the array (not replaced with the array itself).
Load anywhere
This library is compatible with Node.js, the Web and any style of module loader. It can be loaded anywhere, natively without transpilation.
Node.js (CommonJS):
const findReplace = require('find-replace')
Node.js (ECMAScript Module):
import findReplace from 'find-replace'
Modern browser (ECMAScript Module):
import findReplace from './node_modules/find-replace/dist/index.mjs'