{"_id":"@zkochan/which","_rev":"943039","name":"@zkochan/which","description":"Like which(1) unix command. Find the first instance of an executable in the PATH.","dist-tags":{"latest":"2.0.3"},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"time":{"modified":"2021-09-23T02:09:20.000Z","created":"2021-09-14T23:28:57.488Z","2.0.3":"2021-09-14T23:50:27.657Z","2.0.2":"2021-09-14T23:28:57.488Z"},"users":{},"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me"},"repository":{"type":"git","url":"git://github.com/isaacs/node-which.git"},"versions":{"2.0.3":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me"},"name":"@zkochan/which","description":"Like which(1) unix command. Find the first instance of an executable in the PATH.","version":"2.0.3","repository":{"type":"git","url":"git://github.com/isaacs/node-which.git"},"main":"which.js","bin":{"node-which":"bin/node-which"},"license":"ISC","dependencies":{"isexe":"^2.0.0"},"devDependencies":{"mkdirp":"^0.5.0","rimraf":"^2.6.2","tap":"^14.6.9"},"scripts":{"test":"tap","preversion":"npm test","postversion":"npm publish","prepublish":"npm run changelog","prechangelog":"bash gen-changelog.sh","changelog":"git add CHANGELOG.md","postchangelog":"git commit -m 'update changelog - '${npm_package_version}","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"engines":{"node":">= 8"},"gitHead":"f888dab89a46d3e45f9fc76150db8cae2836f6e0","bugs":{"url":"https://github.com/isaacs/node-which/issues"},"homepage":"https://github.com/isaacs/node-which#readme","_id":"@zkochan/which@2.0.3","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"shasum":"a24390359390d38c151fa60781b3620bc5a132d0","size":3365,"noattachment":false,"key":"/@zkochan/which/-/@zkochan/which-2.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/which/download/@zkochan/which-2.0.3.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which_2.0.3_1631663427490_0.9292310714738767"},"_hasShrinkwrap":false,"publish_time":1631663427657,"_cnpm_publish_time":1631663427657},"2.0.2":{"author":{"name":"Isaac Z. Schlueter","email":"i@izs.me","url":"http://blog.izs.me"},"name":"@zkochan/which","description":"Like which(1) unix command. Find the first instance of an executable in the PATH.","version":"2.0.2","repository":{"type":"git","url":"git://github.com/isaacs/node-which.git"},"main":"which.js","bin":{"node-which":"bin/node-which"},"license":"ISC","dependencies":{"isexe":"^2.0.0"},"devDependencies":{"mkdirp":"^0.5.0","rimraf":"^2.6.2","tap":"^14.6.9"},"scripts":{"test":"tap","preversion":"npm test","postversion":"npm publish","prepublish":"npm run changelog","prechangelog":"bash gen-changelog.sh","changelog":"git add CHANGELOG.md","postchangelog":"git commit -m 'update changelog - '${npm_package_version}","postpublish":"git push origin --follow-tags"},"tap":{"check-coverage":true},"engines":{"node":">= 8"},"gitHead":"6a822d836de79f92fb3170f685a6e283fbfeff87","bugs":{"url":"https://github.com/isaacs/node-which/issues"},"homepage":"https://github.com/isaacs/node-which#readme","_id":"@zkochan/which@2.0.2","_nodeVersion":"16.9.1","_npmVersion":"7.21.1","dist":{"shasum":"78e2a8d4f45e08ceee0cf2527bac13fdea3525e2","size":3366,"noattachment":false,"key":"/@zkochan/which/-/@zkochan/which-2.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/@zkochan/which/download/@zkochan/which-2.0.2.tgz"},"_npmUser":{"name":"zkochan","email":"z@kochan.io"},"directories":{},"maintainers":[{"name":"zkochan","email":"zoltan.kochan+github@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which_2.0.2_1631662137237_0.3099617536855397"},"_hasShrinkwrap":false,"publish_time":1631662137488,"_cnpm_publish_time":1631662137488}},"readme":"# which\r\n\r\nLike the unix `which` utility.\r\n\r\nFinds the first instance of a specified executable in the PATH\r\nenvironment variable.  Does not cache the results, so `hash -r` is not\r\nneeded when the PATH changes.\r\n\r\nUnlike the original version of this package, this does not look\r\nfor the binary in the CWD on Windows. This is change was needed\r\nto avoid binary planting attacks.\r\n\r\n## USAGE\r\n\r\n```javascript\r\nvar which = require('which')\r\n\r\n// async usage\r\nwhich('node', function (er, resolvedPath) {\r\n  // er is returned if no \"node\" is found on the PATH\r\n  // if it is found, then the absolute path to the exec is returned\r\n})\r\n\r\n// or promise\r\nwhich('node').then(resolvedPath => { ... }).catch(er => { ... not found ... })\r\n\r\n// sync usage\r\n// throws if not found\r\nvar resolved = which.sync('node')\r\n\r\n// if nothrow option is used, returns null if not found\r\nresolved = which.sync('node', {nothrow: true})\r\n\r\n// Pass options to override the PATH and PATHEXT environment vars.\r\nwhich('node', { path: someOtherPath }, function (er, resolved) {\r\n  if (er)\r\n    throw er\r\n  console.log('found at %j', resolved)\r\n})\r\n```\r\n\r\n## CLI USAGE\r\n\r\nSame as the BSD `which(1)` binary.\r\n\r\n```\r\nusage: which [-as] program ...\r\n```\r\n\r\n## OPTIONS\r\n\r\nYou may pass an options object as the second argument.\r\n\r\n- `path`: Use instead of the `PATH` environment variable.\r\n- `pathExt`: Use instead of the `PATHEXT` environment variable.\r\n- `all`: Return all matches, instead of just the first one.  Note that\r\n  this means the function returns an array of strings instead of a\r\n  single string.\r\n","_attachments":{},"homepage":"https://github.com/isaacs/node-which#readme","bugs":{"url":"https://github.com/isaacs/node-which/issues"},"license":"ISC"}