Comparing version 1.0.0 to 1.0.1
{ | ||
"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 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
7498
1
0
104
8