Skip to content

Instantly share code, notes, and snippets.

@Juul
Created August 18, 2016 12:31
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 Juul/d25b01965c7eb958174dfa48760cedf8 to your computer and use it in GitHub Desktop.
Save Juul/d25b01965c7eb958174dfa48760cedf8 to your computer and use it in GitHub Desktop.
trippy.cat
#!/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