Socket
Socket
Sign inDemoInstall

npm-which

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

npm-which - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1

27

package.json
{
"name": "npm-which",
"version": "1.0.0",
"description": "which(1) with executables from npm modules.",
"version": "1.0.1",
"description": "Locate a program or locally installed node module's executable",
"main": "index.js",
"bin": "bin/npm-which.js",
"bin": {
"npm-which": "bin/npm-which.js"
},
"scripts": {

@@ -20,3 +22,20 @@ "test": "faucet"

"tape": "^2.12.3"
}
},
"directories": {
"test": "test"
},
"repository": {
"type": "git",
"url": "https://github.com/timoxley/npm-which.git"
},
"keywords": [
"npm",
"path",
"executable",
"run"
],
"bugs": {
"url": "https://github.com/timoxley/npm-which/issues"
},
"homepage": "https://github.com/timoxley/npm-which"
}
# npm-which
### Locate a program or locally installed node module's executable
### Locate a program or locally installed node module executable

@@ -12,4 +12,12 @@ Use `npm-which` to locate executables which may be installed in the

## Installation
```bash
> npm install -g npm-which
```
## Usage
### Command Line
```bash

@@ -49,2 +57,35 @@ > npm-which tape

### Programmatic
#### Asynchronous
```js
var which = require('npm-which')
which('tape', function(err, pathToTape) {
if (err) return console.error(err.message)
console.log(pathToTape) // /Users/.../node_modules/.bin/tape
})
```
#### Synchronous
```js
var which = require('npm-which')
var pathToTape = which.sync('tape')
console.log(pathToTape) // /Users/.../node_modules/.bin/tape
```
#### Options
Both async and sync versions take an optional options object:
* Set `options.env` if you wish to use something other than `process.env` (the default)
* Set `options.cwd` if you wish to use something other than `process.cwd()` (the default)
```js
which('tape', {cwd: '/some/other/path'}, function() {
// ...
})
```
## Why

@@ -51,0 +92,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc