-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
data
or record
deprecated?
#73
Comments
The reason I'm asking is because this code does not work at all: csv.fromPath(process.argv[2], {
trim: true,
headers: true,
ignoreEmpty: true
}).on('error', function() {
console.log('error', arguments);
}).on('data', function(data){
console.log('DATA', data);
}).on('end', function() {
console.log('done');
}); But this code works fine: csv.fromPath(process.argv[2], {
trim: true,
headers: true,
ignoreEmpty: true
}).on('error', function() {
console.log('error', arguments);
}).on('record', function(data){
console.log('DATA', data);
}).on('end', function() {
console.log('done');
}); |
What version are you using? |
0.5.2! |
What node version? |
0.11.14 -- that could be the problem if you are transforming the |
This is going to take a little digging it works great on v0.10 but I have not tried it on 11...Ill dig in a little more and let you know what I find |
Ok after a little digging the streams pause/resume functions have been completely redone so you dont have to override them to get pause/resume functionality. Working on a fix. Should note it was the implementing code that caused your stream not to go into flowing mode and therefore the data events were not emitted |
Fixed with tests as of |
Thanks so much! This version works great-- |
The parser stream code clearly emits
record
: https://github.com/C2FO/fast-csv/blob/master/lib/parser/parser_stream.js#L192-L197And the tests clearly all use
record
, e.g. https://github.com/C2FO/fast-csv/blob/master/test/fast-csv.test.js#L461 (or seem to use some weird mix ofdata
andrecord
)But the Readme notes that
record
is deprecated: https://github.com/C2FO/fast-csv/blame/master/README.md#L37So I'm confused whether the
emitRecord
function inparser_stream
is incorrect or the Readme?The text was updated successfully, but these errors were encountered: