Skip to content

Instantly share code, notes, and snippets.

@TheRoccoB
Created January 13, 2015 23:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TheRoccoB/200b4e814f15d44f9ace to your computer and use it in GitHub Desktop.
Save TheRoccoB/200b4e814f15d44f9ace to your computer and use it in GitHub Desktop.
//base 64 encoding with node.js
// usage: node b64.js inputFile outputFile
var fs = require('fs');
if (process.argv.length < 3){
getSubsetCSS(process.argv[2], (process.argv.length > 3) ? process.argv[3] : '400', getWoff);
console.log('usage node b64.js inputFile outputFile');
}
else{
fs.readFile(process.argv[2], function(err, data) {
var base64data = new Buffer(data).toString('base64');
fs.writeFile(process.argv[3], base64data, function(err) {
if(err) {
console.log(err);
}
});
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment