String matcher that output the input string replacing the match.
I created this module for be easy create a pipeline string processor, where the output of a pipe is the input of the next pipe.
$ npm install str-match --save
const strmatch = require('str-match')({ replacement: 'gift' })
const str = "I'm selling my Macbook Pro"
const regex = /selling/i
const detection = strmatch(str, regex)
console.log(detection)
// {
// test: true,
// match: 'Macbook Pro',
// input: 'I\'m selling my Macbook Pro',
// output: 'I\'m gift my Macbook Pro'
// }
Type: string
Default: ''
Type: string
Default: ''
Required
Type: string
Required
Type: regexp
MIT © Kiko Beats.