I love `sed`, but specifying in-place replacement across linux/mac is challenging, and I find both the regular expression options hard to remember the exact syntax for.
So I built a small wrapper around String.prototype.replace to give the syntax and power of javascript regular expressions (and, optionally, javascript functions):
https://github.com/ariabuckles/jsed
Or to install:
npm install -g @ariabuckles/jsed
Some examples:
You can use it pretty similarly to `sed`:
echo "this is a test" | jsed 'w+' 'word:$&'
> word:this word:is word:a word:test
Or you can use it more like javascript when needed: