npm-run-path
Advanced tools
Comparing version 3.1.0 to 4.0.0
@@ -16,2 +16,11 @@ declare namespace npmRunPath { | ||
readonly path?: string; | ||
/** | ||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH. | ||
This can be either an absolute path or a path relative to the `cwd` option. | ||
@default process.execPath | ||
*/ | ||
readonly execPath?: string; | ||
} | ||
@@ -35,2 +44,11 @@ | ||
readonly env?: ProcessEnv; | ||
/** | ||
Path to the current Node.js executable. Its directory is pushed to the front of PATH. | ||
This can be either an absolute path or a path relative to the `cwd` option. | ||
@default process.execPath | ||
*/ | ||
readonly execPath?: string; | ||
} | ||
@@ -37,0 +55,0 @@ } |
@@ -9,2 +9,3 @@ 'use strict'; | ||
path: process.env[pathKey()], | ||
execPath: process.execPath, | ||
...options | ||
@@ -24,3 +25,4 @@ }; | ||
// Ensure the running `node` binary is used | ||
result.push(path.dirname(process.execPath)); | ||
const execPathDir = path.resolve(options.cwd, options.execPath, '..'); | ||
result.unshift(execPathDir); | ||
@@ -27,0 +29,0 @@ return result.concat(options.path).join(path.delimiter); |
{ | ||
"name": "npm-run-path", | ||
"version": "3.1.0", | ||
"version": "4.0.0", | ||
"description": "Get your PATH prepended with locally installed binaries", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -36,3 +36,3 @@ # npm-run-path [![Build Status](https://travis-ci.org/sindresorhus/npm-run-path.svg?branch=master)](https://travis-ci.org/sindresorhus/npm-run-path) | ||
### npmRunPath([options]) | ||
### npmRunPath(options?) | ||
@@ -43,2 +43,4 @@ Returns the augmented path string. | ||
Type: `object` | ||
##### cwd | ||
@@ -59,4 +61,13 @@ | ||
### npmRunPath.env([options]) | ||
##### execPath | ||
Type: `string`<br> | ||
Default: `process.execPath` | ||
Path to the current Node.js executable. Its directory is pushed to the front of PATH. | ||
This can be either an absolute path or a path relative to the [`cwd` option](#cwd). | ||
### npmRunPath.env(options?) | ||
Returns the augmented [`process.env`](https://nodejs.org/api/process.html#process_process_env) object. | ||
@@ -66,3 +77,3 @@ | ||
Type: `Object` | ||
Type: `object` | ||
@@ -82,3 +93,12 @@ ##### cwd | ||
##### execPath | ||
Type: `string`<br> | ||
Default: `process.execPath` | ||
Path to the Node.js executable to use in child processes if that is different from the current one. Its directory is pushed to the front of PATH. | ||
This can be either an absolute path or a path relative to the [`cwd` option](#cwd). | ||
## Related | ||
@@ -90,4 +110,12 @@ | ||
## License | ||
--- | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-npm-run-path?utm_source=npm-npm-run-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> | ||
</b> | ||
<br> | ||
<sub> | ||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. | ||
</sub> | ||
</div> |
8131
104
116
3