Efficient way of eplacing a string in an external javascript file?
Extarys opened this issue · comments
Let me start by saying this project looks awesome.
I need to replace a string inside a javascript file before sending it from a server.
var file = 'var test = ${var}' // or fs.createReadStream('my.js', 'utf8')
reply
.header('Content-Type', 'application/javascript; charset=UTF-8')
// replace placeholder in js file
.send(file)
Would this be possible with this package? 😄
Thanks!
Hi, for this String.replace
would be most appropriate, but this package exports a tag called replaceStringTransformer
that could solve your problem.