Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
@types/which
Advanced tools
The @types/which package provides TypeScript type definitions for the 'which' npm package. 'which' is a utility that locates and returns the path to an executable in the system path, similar to the Unix 'which' command. The @types/which package does not contain functionality itself but provides type definitions to help TypeScript developers use the 'which' package with type safety.
Type definitions for finding an executable in the path
This code sample demonstrates how to use the 'which' package with TypeScript type definitions provided by @types/which. It attempts to locate the 'node' executable in the system path and prints its location or an error if not found.
import which from 'which';
which('node', (err, resolvedPath) => {
if (err) {
console.error('Node executable not found');
return;
}
console.log('Node executable located at:', resolvedPath);
});
find-exec is a package that provides similar functionality to 'which', allowing users to find the path of executables in the system path. Unlike @types/which, find-exec does not require separate type definitions as it may already include TypeScript support or be used in a JavaScript context.
locate-path is another package that helps in finding paths of files or directories based on given criteria. While it serves a broader purpose compared to 'which', it can be used to achieve similar results. It differs from @types/which in that it is not specifically focused on executables and does not provide TypeScript types out of the box.
npm install --save @types/which
This package contains type definitions for which 1.0.8 (https://github.com/isaacs/node-which).
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/types-2.0/which
Additional Details
These definitions were written by vvakame https://github.com/vvakame.
FAQs
TypeScript definitions for which
The npm package @types/which receives a total of 1,402,625 weekly downloads. As such, @types/which popularity was classified as popular.
We found that @types/which demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.