1.0.2 • Published 8 years ago

stream-str-replace v1.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Stream-Str-Replace

A Stream transformer and command line utility to find and replace strings in streams.

Sample usage:

var fs = require('fs');
var streamStrReplace = require('stream-str-replace');

process.stdin
	.pipe( streamStrReplace('find', 'replace') )
	.pipe( process.stdout );


fs.createReadStream('package.json')
	.pipe( streamStrReplace('MIT', 'GPL')
	.pipe( fs.createWriteStream( 'package2.json' );

'find' parameter default is ';'

'replace' parameter default value is '\n'

Command line tool (strepl)

>npm install stream-str-replace -g

>path | strepl

>type myFile.txt | strepl find_text replace_text > myNewFile.txt