{"id":711,"url":"https://github.com/npm/node-which","last_synced_at":"2025-05-13T21:11:44.403Z","repository":{"id":533205,"uuid":"2169708","full_name":"npm/node-which","owner":"npm","description":"Like which(1) unix command. Find the first instance of an executable in the PATH.","archived":false,"fork":false,"pushed_at":"2025-04-09T14:29:42.000Z","size":192,"stargazers_count":336,"open_issues_count":4,"forks_count":48,"subscribers_count":26,"default_branch":"main","last_synced_at":"2025-05-08T06:03:00.111Z","etag":null,"topics":["npm-cli"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/npm.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2011-08-07T18:28:30.000Z","updated_at":"2025-04-20T07:49:45.000Z","dependencies_parsed_at":"2023-12-03T04:21:03.104Z","dependency_job_id":"1e68f8af-09aa-42f8-a1cd-520e760fa5a2","html_url":"https://github.com/npm/node-which","commit_stats":{"total_commits":166,"total_committers":20,"mean_commits":8.3,"dds":"0.37349397590361444","last_synced_commit":"b8d11c791296a3baf44703352619621215189b0e"},"previous_names":["isaacs/node-which"],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fnode-which","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fnode-which/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fnode-which/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/npm%2Fnode-which/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/npm","download_url":"https://codeload.github.com/npm/node-which/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253523767,"owners_count":21921822,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["npm-cli"],"created_at":"2024-01-05T20:15:29.404Z","updated_at":"2025-05-13T21:11:39.389Z","avatar_url":"https://github.com/npm.png","language":"JavaScript","readme":"# which\n\nLike the unix `which` utility.\n\nFinds the first instance of a specified executable in the PATH\nenvironment variable.  Does not cache the results, so `hash -r` is not\nneeded when the PATH changes.\n\n## USAGE\n\n```javascript\nconst which = require('which')\n\n// async usage\n// rejects if not found\nconst resolved = await which('node')\n\n// if nothrow option is used, returns null if not found\nconst resolvedOrNull = await which('node', { nothrow: true })\n\n// sync usage\n// throws if not found\nconst resolved = which.sync('node')\n\n// if nothrow option is used, returns null if not found\nconst resolvedOrNull = which.sync('node', { nothrow: true })\n\n// Pass options to override the PATH and PATHEXT environment vars.\nawait which('node', { path: someOtherPath, pathExt: somePathExt })\n```\n\n## CLI USAGE\n\nJust like the BSD `which(1)` binary but using `node-which`.\n\n```\nusage: node-which [-as] program ...\n```\n\nYou can learn more about why the binary is `node-which` and not `which` \n[here](https://github.com/npm/node-which/pull/67)\n\n## OPTIONS\n\nYou may pass an options object as the second argument.\n\n- `path`: Use instead of the `PATH` environment variable.\n- `pathExt`: Use instead of the `PATHEXT` environment variable.\n- `all`: Return all matches, instead of just the first one.  Note that\n  this means the function returns an array of strings instead of a\n  single string.\n","funding_links":[],"categories":["Repository","Packages","Utilities","JavaScript","Libraries"],"sub_categories":["Environment","React Components"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fnode-which","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnpm%2Fnode-which","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnpm%2Fnode-which/lists"}