Python

f = open('helloworld.txt','w')
f.write('line one\n')
f.write('line two\n')
f.close()

Javascript

const fs = require('fs')

let file_content = ""
file_content += 'line one\n'
file_content += ''line two\n'

fs.writeFile('
helloworld.txt', file_content, (err) => {
// throws an error, you could also catch it here
if (err) throw err;

// success case, the file was saved
console.log('
File written!');
});