faker javascript name escape apostrophe

JavaScript
strInputString = strInputString.replace(/'/g, "\\'");

Source

Also in JavaScript: