Skip to content

Instantly share code, notes, and snippets.

@geopet
Created March 27, 2018 21:44
Show Gist options
  • Save geopet/3e49aefdff219e05426d5cd1d008e034 to your computer and use it in GitHub Desktop.
Save geopet/3e49aefdff219e05426d5cd1d008e034 to your computer and use it in GitHub Desktop.
Just a very basic node document writing script
console.log('Starting app.');
const fs = require('fs');
const os = require('os');
const user = os.userInfo();
fs.appendFile('greetings.txt', `Hello, ${user.username}.`, function(err) {
if (err) {
console.log('Unable to write to file');
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment