Created
August 18, 2016 12:31
-
-
Save Juul/d25b01965c7eb958174dfa48760cedf8 to your computer and use it in GitHub Desktop.
trippy.cat
This file contains 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
#!/usr/bin/env node | |
// To use first run: npm install colors through2 | |
var colors = require('colors'); | |
var through = require('through2'); | |
var ins; | |
if(process.argv.length > 2) { | |
var fs = require('fs'); | |
ins = fs.createReadStream(process.argv[2], {encoding: 'utf8'}); | |
} else { | |
ins = process.stdin; | |
} | |
ins.pipe(through(function(chunk, enc, cb) { | |
this.push(chunk.toString('utf8').trap.rainbow); | |
cb(); | |
})).pipe(process.stdout); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment