commandExists should return boolean instead of rejecting

Open
#22 4 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
42/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript
Domain
cli

Research direction

Start at the commandExists entry point and inspect how the promise handles a missing command versus an actual checking error. Verify that a missing command resolves to true or false for async/await callers, while genuine checking errors still reject; add or update tests if the repository provides them.

Written by the indexing model from the issue text.

Description

Unless there was an error with checking if the command exists. It would make more sense and be more idiomatic to have a resolve(true/false) rather than rejecting in the case of the command not existing. This also means you can use async/await syntax: const exists = await commandExists('the-command')

Dominant language
JavaScript
Stars
147
Forks
22
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

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.

More from mathisonian/command-exists

All issues in mathisonian/command-exists

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.