Skip to content

Instantly share code, notes, and snippets.

@rjriel
Created May 28, 2019 13:58
Show Gist options
  • Save rjriel/3e88e34506d59b98037ae12972709af8 to your computer and use it in GitHub Desktop.
Save rjriel/3e88e34506d59b98037ae12972709af8 to your computer and use it in GitHub Desktop.
const fs = require('fs')
const path = require('path')
require('dotenv').config()
const { dataFile, saveDirectory} = process.env
while(true) {
try {
fs.renameSync(dataFile, path.join(saveDirectory,`${Date.now()}.csv`))
} catch(e) {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment