This file contains hidden or 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
// Takes in two flags in when running the terminal process | |
// Example: INPUT=test.js OUTPUT=test2.js node duplicate_file.js | |
const fs = require('fs'); | |
const { INPUT, OUTPUT } = process.env; | |
if(INPUT && OUTPUT) { | |
fs.readFile(INPUT, (err, data) => { | |
if (err) throw err; |