Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Generated on Mar 1, 2024 via pnpm

which 1.2.14

Like which(1) unix command. Find the first instance of an executable in the PATH.
Package summary
Share
0
issues
1
license
2
ISC
Package created
7 Aug 2011
Version published
23 Mar 2017
Maintainers
6
Total deps
2
Direct deps
1
License
ISC

Issues

0
This package has no issues

Licenses

ISC License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
Cannot
hold-liable
Must
include-copyright
include-license
2 Packages, Including:
isexe@2.0.0
which@1.2.14
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of which 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
isexe2.0.03.67 kBISC
prod

Visualizations

Frequently Asked Questions

What does which do?

"Which" is a JavaScript package that mirrors the functionality of the Unix which utility. It searches the PATH environment variable to find the first instance of a specified executable. Importantly, it does not cache the results, so there's no need to use hash -r when the PATH changes, which means it always provides the current and accurate location (if any) of the specified tool or command in the system's PATH.

How do you use which?

The "which" package is pretty straightforward to use in your JavaScript programs. You can incorporate it via require('which').

Here is an example of asynchronous usage:

const which = require('which')

// async usage 
const resolved = await which('node')

// if nothrow option is used, returns null if not found
const resolvedOrNull = await which('node', { nothrow: true })

And synchronous usage:

const which = require('which')

// sync usage
const resolved = which.sync('node')

// if nothrow option is used, returns null if not found
const resolvedOrNull = which.sync('node', { nothrow: true })

You can also override the PATH and PATHEXT environment variables by passing an options object:

await which('node', { path: someOtherPath, pathExt: somePathExt })

It can also be used as a command-line interface tool, with syntax similar to the BSD which(1) binary but through node-which.

Where are the which docs?

The official documentation for the which package is available in the package's readme file on its GitHub repository. Here, you can learn more about its usage, options, and command-line interface: https://github.com/npm/node-which