Earlier quoted context omitted.
> And the sed regex does not support stuff like + Are you talking about BSD sed here, because GNU sed does support + with the -r flag.
And nobody seems to have mentioned the fact that to run this script you'll need to install node and npm (although you can argue that node comes with npm, but anyway…). You might as well just install GNU sed in BSD if that's the problem. Also, I believe GNU sed is much faster than any javascript script. Moreover, if you want to use this as part of your node app, then it's a good reason to reimplement some of sed's fun…
Often not possible depending on what authorizations and hosting you have.