Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Need to call `walker.start()` for `tree.walk()` not documented except in example #1588
Comments
I ran into this as well. I want to add a couple of specific points:
Here are specific suggestions for improvement:
|
I have attempted to address the issues in the referenced PRs. Please let me know if you have any further suggestions for the changes. |
System information
https://www.nodegit.org/api/tree/ has an example of how to use
tree.walk()
, but it doesn't mention a critical detail, which is mentioned in an example:nodegit/examples/walk-tree.js
Lines 22 to 23 in 1f84d31
It looks like the
start()
method is added to the instance here:nodegit/lib/tree.js
Lines 145 to 146 in 1f84d31
It took me quite a while to work out what the problem was, looking at the EventEmitter documentation would not have helped. I'm not sure if subclassing from EventEmitter is a good idea, but having a TreeWalker class where the this is documented would have made it easier to discover.