Skip to content

Commit

Permalink
Update 06 - Builtin modules.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Deividy committed Apr 6, 2018
1 parent db27044 commit 7d7641a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/06 - Builtin modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ const { Writable } = require('stream');

let myUnderlyingResource = '';
class MyFirstWritable extends Writable {
// http://bit.ly/2JoEZe9
// https://nodejs.org/api/stream.html#stream_writable_write_chunk_encoding_callback_1
_write (chunk, encoding, callback) {
// console.log(chunk); // <Buffer .. .. ..>
// console.log(encoding); // buffer
Expand All @@ -206,7 +206,7 @@ myFirstStream.write('foo');
myFirstStream.end('bar');

myFirstStream.on('finish', () => {
console.log(myUnderlyingResource); // foobar
console.log(myUnderlyingResource); // 'foobar'
});

console.log(myUnderlyingResource); // ''
Expand Down

0 comments on commit 7d7641a

Please sign in to comment.