I was wondering how would you escape special characters in nodejs. I have a string $what$ever$ and I need it escaped like \\$what\\$ever\\$ before i call a python script wit
You can do this without any modules:
str.replace(/\\/g, "\\\\") .replace(/\$/g, "\\$") .replace(/'/g, "\\'") .replace(/"/g, "\\\"");