npm-run-path
Advanced tools
Comparing version 5.0.1 to 5.1.0
@@ -7,3 +7,3 @@ export interface RunPathOptions { | ||
*/ | ||
readonly cwd?: string; | ||
readonly cwd?: string | URL; | ||
@@ -35,3 +35,3 @@ /** | ||
*/ | ||
readonly cwd?: string; | ||
readonly cwd?: string | URL; | ||
@@ -38,0 +38,0 @@ /** |
import process from 'node:process'; | ||
import path from 'node:path'; | ||
import url from 'node:url'; | ||
import pathKey from 'path-key'; | ||
@@ -13,3 +14,4 @@ | ||
let previous; | ||
let cwdPath = path.resolve(cwd); | ||
const cwdString = cwd instanceof URL ? url.fileURLToPath(cwd) : cwd; | ||
let cwdPath = path.resolve(cwdString); | ||
const result = []; | ||
@@ -24,3 +26,3 @@ | ||
// Ensure the running `node` binary is used. | ||
result.push(path.resolve(cwd, execPath, '..')); | ||
result.push(path.resolve(cwdString, execPath, '..')); | ||
@@ -27,0 +29,0 @@ return [...result, path_].join(path.delimiter); |
{ | ||
"name": "npm-run-path", | ||
"version": "5.0.1", | ||
"version": "5.1.0", | ||
"description": "Get your PATH prepended with locally installed binaries", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -43,3 +43,3 @@ # npm-run-path | ||
Type: `string`\ | ||
Type: `string | URL`\ | ||
Default: `process.cwd()` | ||
@@ -77,3 +77,3 @@ | ||
Type: `string`\ | ||
Type: `string | URL`\ | ||
Default: `process.cwd()` | ||
@@ -80,0 +80,0 @@ |
8018
93