| Index: tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS
|
| diff --git a/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS b/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..205a42564b5773e0378c066d71b7da34c7b85af7
|
| --- /dev/null
|
| +++ b/tools/vulcanize/node_modules/vulcanize/node_modules/cheerio/node_modules/htmlparser2/node_modules/readable-stream/examples/CAPSLOCKTYPER.JS
|
| @@ -0,0 +1,32 @@
|
| +var Transform = require('../transform');
|
| +var inherits = require('util').inherits;
|
| +
|
| +// subclass
|
| +function MyStream () {
|
| + Transform.call(this, {
|
| + lowWaterMark: 0,
|
| + encoding: 'utf8'
|
| + });
|
| +}
|
| +inherits(MyStream, Transform);
|
| +
|
| +MyStream.prototype._transform = function (chunk, outputFn, callback) {
|
| + outputFn(new Buffer(String(chunk).toUpperCase()));
|
| + callback();
|
| +};
|
| +
|
| +// use it!
|
| +var s = new MyStream();
|
| +process.stdin.resume();
|
| +process.stdin.pipe(s).pipe(process.stdout);
|
| +if (process.stdin.setRawMode)
|
| + process.stdin.setRawMode(true);
|
| +process.stdin.on('data', function (c) {
|
| + c = c.toString();
|
| + if (c === '\u0003' || c === '\u0004') {
|
| + process.stdin.pause();
|
| + s.end();
|
| + }
|
| + if (c === '\r')
|
| + process.stdout.write('\n');
|
| +});
|
|
|