const fs = require('fs');
const path = require('path');
const filename = '/test.js';
const text_to_write_to_file = 'Text text texT'
fs.writeFile(path.join(__dirname, filename), text_to_write_to_file, err => {
if (err) throw err;
console.log(`file ${filename} created`);
});
/*
run:
file /test.js created
*/