Im hoping someone might be able to help with this.
Ive got a text file on the server loaded with the following
var templateCache = '{"templateCache":[ {"test":"123"} ]}';
as its a text file, we are opening it and are aiming to strip out
var templateCache = '----';
so we can convert the string into an object using JSON.stringify().
We are making use of Rhino.js as the server so we can only use vanilla JS functions to process this string into something usable for our app.
Back story
The file is included in the main function of our little app, but for us to manipulate this set of variables we are opening it, converting it into a JSON object and applying whats neccessary to it and then saving it back as the variable so it doesnt impact our app. but I cant figure out how to strip out the var templateCache = ''; and leave the middle content in place and im not sure what to look for via google to get the thing into order