Last active
August 29, 2015 14:14
-
-
Save hpfast/022b19c39d901560263a to your computer and use it in GitHub Desktop.
demo gist
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
<html> | |
<head> | |
<title>Cool stuff</title> | |
<script> | |
document.write('this is cool'); | |
</script> | |
</head> | |
<body> | |
Cool stuff happening here. | |
</body > | |
</html> |
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
"use strict" | |
var fs = require('fs'); | |
function convertThis() { | |
if(process.argv.length > 2) { | |
var myfile = process.argv[2]; | |
if(fs.existsSync(myfile)) { | |
var content = fs.readFileSync(myfile, 'utf8'); | |
fs.writeFileSync(myfile, content.toUpperCase()); | |
console.log("Done"); | |
} else { | |
console.log("File does not exist - " + myfile); | |
} | |
} else { | |
console.log("Pass on a file name/path"); | |
} | |
} | |
exports.convert = convertThis; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment