str-match
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.
Install
$ npm install str-match --save
Usage
const strmatch = replacement: 'gift' const str = "I'm selling my Macbook Pro"const regex = /selling/iconst detection = console// {// test: true,// match: 'Macbook Pro',// input: 'I\'m selling my Macbook Pro',// output: 'I\'m gift my Macbook Pro'// }
API
.constructor([opts])
opts
opts.flags
Type: string
Default: ''
opts.replacement
Type: string
Default: ''
strmatch(str, regex)
str
Required
Type: string
regex
Required
Type: regexp
License
MIT © Kiko Beats.