-
Notifications
You must be signed in to change notification settings - Fork 3
compare files of different length #5
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
Comments
You can use End of file property, ref: https://github.com/niiknow/text-file-diff/blob/master/src/index.ts#L15 const lfd = new TextFileDiff({
skipHeader: argv.skipHeader
});
lfd.on('compared', (line1, line2, cmpar, lineReader1, lineReader2) => {
if (lineReader1.eof > -1 || lineReader2.eof > -1) {
// do something such as exit program, etc...
}
}); The plus (+) and minus (-) events also receive |
@noogen am kinda in the same boat, can u plz elaborate how to actually use that ? for example, lets say the first-stream lines count is 40, while the second stream lines count is 50, how do u get the diff ? |
@ctf0 I don't understand, it already doing that. Have you tried it? Elaborate more on what are you really expect it to do? Even better, look at the unit tests. Fork, upload your 2 files, write unit tests and elaborate on what you're expecting it to do. Do the real Test Driven Development (TDD) approach. |
oh, my bad, i got it totally wrong, thanks again |
I really like this package! Thanks for your hard work!
What I wish it could do: when one file is longer (has more lines) than the other, that it doesn't stop but append all the missing lines to the output (either as being new (+) or old (-) )
The text was updated successfully, but these errors were encountered: