Skip to content

Instantly share code, notes, and snippets.

View seancrater's full-sized avatar

Sean Crater seancrater

  • Raleigh, NC
View GitHub Profile
@seancrater
seancrater / duplicate_file.js
Created February 14, 2018 14:30
Simple Node.js File Duplication Script
// 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;