Re: [nodejs] How to process a stream of lines from a file one-by-one?

2015-04-25 Thread Mark Volkmann
There are several npm modules that do this. One that I wrote is at https://github.com/mvolkmann/node-liner. On Fri, Apr 24, 2015 at 9:36 AM, Marco Ippolito wrote: > Hi all, > I'm trying to extract in "streaming-mode" a list of lines from a txt file > and than process them one-by-one in order, fo

[nodejs] Re: How to process a stream of lines from a file one-by-one?

2015-04-25 Thread Jimb Esser
I'm unfamiliar with the modules you're using, but on first glance it looks like you're piping the read stream to two different things, instead of chaining the pipes, I would think that : rs.pipe(es.split()) rs.pipe(es.map(... perhaps should be: rs.pipe(es.split()) .pipe(es.map(... I've used "l

[nodejs] About Rust and Node integration

2015-04-25 Thread Ω Alisson
https://github.com/alexcrichton/rust-ffi-examples/tree/master/node-to-rust -- Job board: http://jobs.nodejs.org/ New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines --- You rece

Re: [nodejs] [ANN] trepanjs: a more gdb-like debugger for node

2015-04-25 Thread Rocky Bernstein
Thanks On Friday, April 24, 2015 at 1:23:44 PM UTC-4, Cristian Wilgenhoff wrote: > > This is awesome! > > Some links were wrong, here you have the right ones: > > - https://www.npmjs.com/package/trepanjs > - https://github.com/rocky/trepanjs > > -- Job board: http://jobs.nodejs.org/ New group r

Re: [nodejs] How to process a stream of lines from a file one-by-one?

2015-04-25 Thread Ryan Schmidt
On Apr 24, 2015, at 9:36 AM, Marco Ippolito wrote: > > I'm trying to extract in "streaming-mode" a list of lines from a txt file and > than process them one-by-one in order, for example (or could be something > else) to detect the language. Have you tried any of the existing npm modules that c

[nodejs] How to process a stream of lines from a file one-by-one?

2015-04-25 Thread Marco Ippolito
Hi all, this is my code: #!/usr/bin/env node var path = require('path'); var fs = require('fs'); var util = require('util'); var stream = require('stream'); var es = require('event-stream'); var normalized_path = path.normalize(process.argv[2]) var unified_unique_urls_file_path = path.join(proce

[nodejs] Re: How to process a stream of lines from a file one-by-one?

2015-04-25 Thread Ethan Garofolo
If you do something like a.pipe(b), the return value from that call is b. So, I suspect one trouble you're having is when you do: rs.pipe(es.split()) // split stream to break on newlines rs.pipe(es.map(function(line) { (function() { callback(line) })(); }) I'm assuming that you

Re: [nodejs] How to process a stream of lines from a file one-by-one?

2015-04-25 Thread Daniel Rinehart
You are not properly chaining your stream. The main problem is in these two lines: rs.pipe(es.split()) // split stream to break on newlines rs.pipe(es.map(function(line) { You are setting up two independent pipes instead of chaining the output stream of the split into the map: rs..pipe(es.split(