Coder Social home page Coder Social logo

Comments (5)

dbrown2642 avatar dbrown2642 commented on May 26, 2024 1

Also on Mac, using your terminal command worked for me. I was originally adding lines through VSCode which it appears must save files in a way that makes node think each line is being generated again. Apologies for the confusion.

from node-tail.

lucagrulla avatar lucagrulla commented on May 26, 2024

That shouldn't be the case.
I manually rested the library (adding a new line to an existing file) and I cannot replicate what you suggest.

Which version of tail are you using?

from node-tail.

dbrown2642 avatar dbrown2642 commented on May 26, 2024

Currently on version 1.2.4.
Running the code I attached, if I create the a single line in fileToTail.txt with the text "first line", the terminal will output:

first line

If I then create a second line with the text "second line", the terminal with now read:

first line
first line
second line

Attempting this in debug mode, if I create a third line with the text "third line" and create a breakpoint inside my tail.on("line") function, I find that my function executes three times, with the data object as each of the lines (first "first line", then "second line", then "third line").

from node-tail.

lucagrulla avatar lucagrulla commented on May 26, 2024

Which OS are you using?
Which nodejs version?
How do you append the line to the file?

To give you my test setup:
-OSX

  • nodejs 10.4.0 (but I tried also on a much older release)
    I appended text with:
    echo "new line" >> fileToTail.txt

from node-tail.

lucagrulla avatar lucagrulla commented on May 26, 2024

Glad to hear it's working as expected.
I'll close the issue.

from node-tail.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.