lib/traphandler.js
/**
 * We'd usually expect the whole trap data to be sent in a single chunk,
 * but we'll buffer here, just to make sure.
 * @returns {bluebird|exports|module.exports}
 */
We'd usually expect the whole trap data to be sent in a single chunk,
but we'll buffer here, just to make sure.
We ' d usually expect the whole trap data to be sent in a single chunk but we ' ll buffer here just to make sure .
function readStdin() {
	var buffer = "";
	if( argv.file ) {
		return readTrapFromFile( argv.file );
	}
	return new Promise( function( resolve, reject ) {
		process.stdin.resume();
		process.stdin.setEncoding( "utf8" );
		process.stdin.on( "data", function( data ) {
			buffer += data;
		} );
		process.stdin.on( "end", function onEnd() {
			resolve( buffer );
		} );
		process.stdin.on( "error", reject );
	} );
}
function readStdin ( ) { var buffer = "" ; if ( argv . file ) { return readTrapFromFile ( argv . file ) ; } return new Promise ( function ( resolve , reject ) { process . stdin . resume ( ) ; process . stdin . setEncoding ( "utf8" ) ; process . stdin . on ( "data" , function ( data ) { buffer += data ; } ) ; process . stdin . on ( "end" , function onEnd ( ) { resolve ( buffer ) ; } ) ; process . stdin . on ( "error" , reject ) ; } ) ; }
We'd usually expect the whole trap data to be sent in a single chunk,
 but we'll buffer here, just to make sure.
We ' d usually expect the whole trap data to be sent in a single chunk but we ' ll buffer here just to make sure .