Created
October 6, 2015 20:45
-
-
Save etyp/baee887a668866631c51 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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