Skip to content

Instantly share code, notes, and snippets.

@etyp
Created October 6, 2015 20:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save etyp/baee887a668866631c51 to your computer and use it in GitHub Desktop.
Save etyp/baee887a668866631c51 to your computer and use it in GitHub Desktop.
var remote = nodeRequire('remote');
var fs = remote.require('fs');
// Get date time
var now = new Date();
// Create file name based on date
var fileName = now.getFullYear() + '-' + now.getMonth() + '-' + now.getDay() + '-at-' + now.getHours() + '-' + now.getMinutes() + '-' + now.getSeconds() + '-tasting.json';
// Write data into the json folder
fs.writeFile('HARDCODE-TASTING-DATE-DIR-HERE' + '/' + fileName, data, function (err) {
if (err) {
logger.error(err);
} else {
// Sync!
// tell the electron main to call self.syn() somehow - maybe through an ipc method?
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment