You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
15 lines
353 B
CoffeeScript
15 lines
353 B
CoffeeScript
fs = require "fs"
|
|
stream = require "stream"
|
|
|
|
transform = new stream.Transform(highWaterMark: 200 * 1024)
|
|
transform._transform = (chunk, encoding, callback) ->
|
|
console.log "Got chunk, length", chunk.length
|
|
@push chunk
|
|
callback()
|
|
|
|
console.log "Starting stream..."
|
|
fs.createReadStream "./lower.txt"
|
|
.pipe transform
|
|
.on "end", ->
|
|
console.log "Done!"
|