nodegit / nodegit/nodegit

Functions that return an EventEmitter should instead return a Promise

Open
#1,025 0 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
5.8k
Forks
704
PR merge metrics
No merged PRs in 30d

Description

The only two functions that do this are Commit.history and Tree.walk.

All other async functions in nodegit return promises.

Current:

tree.walk()
  .on('entry', singleEntryCallback)
  .on('end', allEntriesCallback)
  .start();

Proposed change:

tree.walk(singleEntryCallback)
  .then(allEntriesCallback);

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the JavaScript entry points for Commit.history and Tree.walk. Compare their current EventEmitter usage with the proposed callback-and-Promise form, then verify that both functions follow the same async convention as the other NodeGit functions. Done means both APIs use the proposed form and their existing entry and completion behavior remains covered.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.