I'm trying to put a variable as ${Y}
in but in the output I got (how can I write variable ${Y}
)
instead of the data in Y
is someone have any solution?
const fs = require('fs');
const Y = fs.readFileSync('./txt/input.txt','utf-8')
const Z='how can i write variable ${Y}';
fs.writeFileSync('./txt/output.txt',Z);
console.log('File written!');