-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
npx is an npm package runner with a bunch of nice features. While it is also available on the npm registry as `npx`, it's the sort of thing that's better off being bundles with npm itself. Fixes: npm#6053 PR-URL: npm/npm#17685 Credit: @zkat Reviewed-By: @iarna
- Loading branch information
Showing
779 changed files
with
58,510 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
#!/bin/sh | ||
(set -o igncr) 2>/dev/null && set -o igncr; # cygwin encoding fix | ||
|
||
basedir=`dirname "$0"` | ||
|
||
case `uname` in | ||
*CYGWIN*) basedir=`cygpath -w "$basedir"`;; | ||
esac | ||
|
||
NODE_EXE="$basedir/node.exe" | ||
if ! [ -x "$NODE_EXE" ]; then | ||
NODE_EXE=node | ||
fi | ||
|
||
NPX_CLI_JS="$basedir/node_modules/npm/bin/npx-cli.js" | ||
|
||
case `uname` in | ||
*MINGW*) | ||
NPM_PREFIX=`"$NODE_EXE" "$NPX_CLI_JS" prefix -g` | ||
NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" | ||
if [ -f "$NPM_PREFIX_NPX_CLI_JS" ]; then | ||
NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" | ||
fi | ||
;; | ||
*CYGWIN*) | ||
NPM_PREFIX=`"$NODE_EXE" "$NPX_CLI_JS" prefix -g` | ||
NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" | ||
if [ -f "$NPM_PREFIX_NPX_CLI_JS" ]; then | ||
NPX_CLI_JS="$NPM_PREFIX_NPX_CLI_JS" | ||
fi | ||
;; | ||
esac | ||
|
||
"$NODE_EXE" "$NPX_CLI_JS" "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env node | ||
|
||
const npx = require('libnpx') | ||
const path = require('path') | ||
|
||
const NPM_PATH = path.join(__dirname, 'npm-cli.js') | ||
|
||
npx(npx.parseArgs(process.argv, NPM_PATH)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
:: Created by npm, please don't edit manually. | ||
@ECHO OFF | ||
|
||
SETLOCAL | ||
|
||
SET "NODE_EXE=%~dp0\node.exe" | ||
IF NOT EXIST "%NODE_EXE%" ( | ||
SET "NODE_EXE=node" | ||
) | ||
|
||
SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js" | ||
FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPX_CLI_JS%" prefix -g') DO ( | ||
SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js" | ||
) | ||
IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" ( | ||
SET "NPX_CLI_JS=%NPM_PREFIX_NPX_CLI_JS%" | ||
) | ||
|
||
"%NODE_EXE%" "%NPX_CLI_JS%" %* |
Oops, something went wrong.