writing files in javascript
'use strict'
const fs = require('fs');
let fileContent = 'I can write';
fs.writeFileSync('message.txt', fileContent);
writing files in javascript
'use strict'
const fs = require('fs');
let fileContent = 'I can write';
fs.writeFileSync('message.txt', fileContent);
javascript write to file
<script>
// Requiring fs module in which
// writeFile function is defined.
const fs = require('fs')
// Data which will write in a file.
let data = "Learning how to write in a file."
// Write data in 'Output.txt' .
fs.writeFile('Output.txt', data, (err) => {
// In case of a error throw err.
if (err) throw err;
})
</script>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us