Skip to content

Instantly share code, notes, and snippets.

@afaur
Created December 1, 2016 08:30
Show Gist options
  • Save afaur/2912036d206d2ececc704ef9086b0a62 to your computer and use it in GitHub Desktop.
Save afaur/2912036d206d2ececc704ef9086b0a62 to your computer and use it in GitHub Desktop.
Filter vim using `!` for example `!!node filter_vim.js` will remove the vowels of the current line.
process.stdin.setEncoding('utf8')
var chunks = []
process.stdin.on('readable', function () {
var chunk = process.stdin.read()
chunks.push(chunk)
})
process.stdin.on('end', function () {
var input = chunks.join('')
var output = input.replace(/[aeiou]+/g, '')
process.stdout.write(output)
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment