| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent be587e3 commit 26b1231
418 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,35 +1,32 @@ | |||
| 1 | 1 | #!/usr/bin/env pwsh | |
| 2 | - $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent | ||
| 3 | 2 | ||
| 4 | - $exe="" | ||
| 5 | - if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ||
| 6 | - # Fix case when both the Windows and Linux builds of Node | ||
| 7 | - # are installed in the same directory | ||
| 8 | - $exe=".exe" | ||
| 3 | + $NODE_EXE="$PSScriptRoot/node.exe" | ||
| 4 | + if (-not (Test-Path $NODE_EXE)) { | ||
| 5 | + $NODE_EXE="$PSScriptRoot/node" | ||
| 9 | 6 | } | |
| 10 | - $ret=0 | ||
| 11 | - | ||
| 12 | - $nodeexe = "node$exe" | ||
| 13 | - $nodebin = $(Get-Command $nodeexe -ErrorAction SilentlyContinue -ErrorVariable F).Source | ||
| 14 | - if ($nodebin -eq $null) { | ||
| 15 | - Write-Host "$nodeexe not found." | ||
| 16 | - exit 1 | ||
| 7 | + if (-not (Test-Path $NODE_EXE)) { | ||
| 8 | + $NODE_EXE="node" | ||
| 17 | 9 | } | |
| 18 | - $nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path | ||
| 19 | 10 | ||
| 20 | - $npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js" | ||
| 21 | - $npmprefix=(& $nodeexe $npmprefixjs) | ||
| 11 | + $NPM_PREFIX_JS="$PSScriptRoot/node_modules/npm/bin/npm-prefix.js" | ||
| 12 | + $NPM_CLI_JS="$PSScriptRoot/node_modules/npm/bin/npm-cli.js" | ||
| 13 | + $NPM_PREFIX=(& $NODE_EXE $NPM_PREFIX_JS) | ||
| 14 | + | ||
| 22 | 15 | if ($LASTEXITCODE -ne 0) { | |
| 23 | 16 | Write-Host "Could not determine Node.js install directory" | |
| 24 | 17 | exit 1 | |
| 25 | 18 | } | |
| 26 | - $npmprefixclijs="$npmprefix/node_modules/npm/bin/npm-cli.js" | ||
| 19 | + | ||
| 20 | + $NPM_PREFIX_NPM_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npm-cli.js" | ||
| 21 | + if (Test-Path $NPM_PREFIX_NPM_CLI_JS) { | ||
| 22 | + $NPM_CLI_JS=$NPM_PREFIX_NPM_CLI_JS | ||
| 23 | + } | ||
| 27 | 24 | ||
| 28 | 25 | # Support pipeline input | |
| 29 | 26 | if ($MyInvocation.ExpectingInput) { | |
| 30 | - $input | & $nodeexe $npmprefixclijs $args | ||
| 27 | + $input | & $NODE_EXE $NPM_CLI_JS $args | ||
| 31 | 28 | } else { | |
| 32 | - & $nodeexe $npmprefixclijs $args | ||
| 29 | + & $NODE_EXE $NPM_CLI_JS $args | ||
| 33 | 30 | } | |
| 34 | - $ret=$LASTEXITCODE | ||
| 35 | - exit $ret | ||
| 31 | + | ||
| 32 | + exit $LASTEXITCODE | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ const removed = new Set([ | |||
| 26 | 26 | ||
| 27 | 27 | const { definitions, shorthands } = require('@npmcli/config/lib/definitions') | |
| 28 | 28 | const npmSwitches = Object.entries(definitions) | |
| 29 | - .filter(([key, { type }]) => type === Boolean || | ||
| 29 | + .filter(([, { type }]) => type === Boolean || | ||
| 30 | 30 | (Array.isArray(type) && type.includes(Boolean))) | |
| 31 | 31 | .map(([key]) => key) | |
| 32 | 32 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,35 +1,32 @@ | |||
| 1 | 1 | #!/usr/bin/env pwsh | |
| 2 | - $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent | ||
| 3 | 2 | ||
| 4 | - $exe="" | ||
| 5 | - if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) { | ||
| 6 | - # Fix case when both the Windows and Linux builds of Node | ||
| 7 | - # are installed in the same directory | ||
| 8 | - $exe=".exe" | ||
| 3 | + $NODE_EXE="$PSScriptRoot/node.exe" | ||
| 4 | + if (-not (Test-Path $NODE_EXE)) { | ||
| 5 | + $NODE_EXE="$PSScriptRoot/node" | ||
| 9 | 6 | } | |
| 10 | - $ret=0 | ||
| 11 | - | ||
| 12 | - $nodeexe = "node$exe" | ||
| 13 | - $nodebin = $(Get-Command $nodeexe -ErrorAction SilentlyContinue -ErrorVariable F).Source | ||
| 14 | - if ($nodebin -eq $null) { | ||
| 15 | - Write-Host "$nodeexe not found." | ||
| 16 | - exit 1 | ||
| 7 | + if (-not (Test-Path $NODE_EXE)) { | ||
| 8 | + $NODE_EXE="node" | ||
| 17 | 9 | } | |
| 18 | - $nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path | ||
| 19 | 10 | ||
| 20 | - $npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js" | ||
| 21 | - $npmprefix=(& $nodeexe $npmprefixjs) | ||
| 11 | + $NPM_PREFIX_JS="$PSScriptRoot/node_modules/npm/bin/npm-prefix.js" | ||
| 12 | + $NPX_CLI_JS="$PSScriptRoot/node_modules/npm/bin/npx-cli.js" | ||
| 13 | + $NPM_PREFIX=(& $NODE_EXE $NPM_PREFIX_JS) | ||
| 14 | + | ||
| 22 | 15 | if ($LASTEXITCODE -ne 0) { | |
| 23 | 16 | Write-Host "Could not determine Node.js install directory" | |
| 24 | 17 | exit 1 | |
| 25 | 18 | } | |
| 26 | - $npmprefixclijs="$npmprefix/node_modules/npm/bin/npx-cli.js" | ||
| 19 | + | ||
| 20 | + $NPM_PREFIX_NPX_CLI_JS="$NPM_PREFIX/node_modules/npm/bin/npx-cli.js" | ||
| 21 | + if (Test-Path $NPM_PREFIX_NPX_CLI_JS) { | ||
| 22 | + $NPX_CLI_JS=$NPM_PREFIX_NPX_CLI_JS | ||
| 23 | + } | ||
| 27 | 24 | ||
| 28 | 25 | # Support pipeline input | |
| 29 | 26 | if ($MyInvocation.ExpectingInput) { | |
| 30 | - $input | & $nodeexe $npmprefixclijs $args | ||
| 27 | + $input | & $NODE_EXE $NPX_CLI_JS $args | ||
| 31 | 28 | } else { | |
| 32 | - & $nodeexe $npmprefixclijs $args | ||
| 29 | + & $NODE_EXE $NPX_CLI_JS $args | ||
| 33 | 30 | } | |
| 34 | - $ret=$LASTEXITCODE | ||
| 35 | - exit $ret | ||
| 31 | + | ||
| 32 | + exit $LASTEXITCODE | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ description: Set access level on published packages | |||
| 7 | 7 | ### Synopsis | |
| 8 | 8 | ||
| 9 | 9 | ```bash | |
| 10 | - npm access list packages [<user>|<scope>|<scope:team> [<package>] | ||
| 10 | + npm access list packages [<user>|<scope>|<scope:team>] [<package>] | ||
| 11 | 11 | npm access list collaborators [<package> [<user>]] | |
| 12 | 12 | npm access get status [<package>] | |
| 13 | 13 | npm access set status=public|private [<package>] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ description: Check the health of your npm environment | |||
| 7 | 7 | ### Synopsis | |
| 8 | 8 | ||
| 9 | 9 | ```bash | |
| 10 | - npm doctor [ping] [registry] [versions] [environment] [permissions] [cache] | ||
| 10 | + npm doctor [connection] [registry] [versions] [environment] [permissions] [cache] | ||
| 11 | 11 | ``` | |
| 12 | 12 | ||
| 13 | 13 | Note: This command is unaware of workspaces. | |
@@ -38,20 +38,21 @@ there are any recommended changes, it will display them. By default npm | |||
| 38 | 38 | runs all of these checks. You can limit what checks are ran by | |
| 39 | 39 | specifying them as extra arguments. | |
| 40 | 40 | ||
| 41 | - #### `npm ping` | ||
| 41 | + #### `Connecting to the registry` | ||
| 42 | 42 | ||
| 43 | 43 | By default, npm installs from the primary npm registry, | |
| 44 | - `registry.npmjs.org`. `npm doctor` hits a special ping endpoint within the | ||
| 45 | - registry. This can also be checked with `npm ping`. If this check fails, | ||
| 46 | - you may be using a proxy that needs to be configured, or may need to talk | ||
| 47 | - to your IT staff to get access over HTTPS to `registry.npmjs.org`. | ||
| 44 | + `registry.npmjs.org`. `npm doctor` hits a special connection testing | ||
| 45 | + endpoint within the registry. This can also be checked with `npm ping`. | ||
| 46 | + If this check fails, you may be using a proxy that needs to be | ||
| 47 | + configured, or may need to talk to your IT staff to get access over | ||
| 48 | + HTTPS to `registry.npmjs.org`. | ||
| 48 | 49 | ||
| 49 | 50 | This check is done against whichever registry you've configured (you can | |
| 50 | 51 | see what that is by running `npm config get registry`), and if you're using | |
| 51 | 52 | a private registry that doesn't support the `/whoami` endpoint supported by | |
| 52 | 53 | the primary registry, this check may fail. | |
| 53 | 54 | ||
| 54 | - #### `npm -v` | ||
| 55 | + #### `Checking npm version` | ||
| 55 | 56 | ||
| 56 | 57 | While Node.js may come bundled with a particular version of npm, it's the | |
| 57 | 58 | policy of the CLI team that we recommend all users run `npm@latest` if they | |
@@ -61,7 +62,7 @@ support releases typically only receive critical security and regression | |||
| 61 | 62 | fixes. The team believes that the latest tested version of npm is almost | |
| 62 | 63 | always likely to be the most functional and defect-free version of npm. | |
| 63 | 64 | ||
| 64 | - #### `node -v` | ||
| 65 | + #### `Checking node version` | ||
| 65 | 66 | ||
| 66 | 67 | For most users, in most circumstances, the best version of Node will be the | |
| 67 | 68 | latest long-term support (LTS) release. Those of you who want access to new | |
@@ -70,7 +71,7 @@ be running a newer version, and some may be required to run an older | |||
| 70 | 71 | version of Node because of enterprise change control policies. That's OK! | |
| 71 | 72 | But in general, the npm team recommends that most users run Node.js LTS. | |
| 72 | 73 | ||
| 73 | - #### `npm config get registry` | ||
| 74 | + #### `Checking configured npm registry` | ||
| 74 | 75 | ||
| 75 | 76 | You may be installing from private package registries for your project or | |
| 76 | 77 | company. That's great! Others may be following tutorials or StackOverflow | |
@@ -79,7 +80,7 @@ Sometimes, this may entail changing the registry you're pointing at. This | |||
| 79 | 80 | part of `npm doctor` just lets you, and maybe whoever's helping you with | |
| 80 | 81 | support, know that you're not using the default registry. | |
| 81 | 82 | ||
| 82 | - #### `which git` | ||
| 83 | + #### `Checking for git executable in PATH` | ||
| 83 | 84 | ||
| 84 | 85 | While it's documented in the README, it may not be obvious that npm needs | |
| 85 | 86 | Git installed to do many of the things that it does. Also, in some cases | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,7 +27,7 @@ packages will *also* show the paths to the specified packages. For | |||
| 27 | 27 | example, running `npm ls promzard` in npm's source tree will show: | |
| 28 | 28 | ||
| 29 | 29 | ```bash | |
| 30 | - npm@10.5.2 /path/to/npm | ||
| 30 | + npm@10.7.0 /path/to/npm | ||
| 31 | 31 | └─┬ init-package-json@0.0.4 | |
| 32 | 32 | └── promzard@0.1.5 | |
| 33 | 33 | ``` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -24,28 +24,17 @@ support this interface. | |||
| 24 | 24 | * `npm profile get [<property>]`: Display all of the properties of your | |
| 25 | 25 | profile, or one or more specific properties. It looks like: | |
| 26 | 26 | ||
| 27 | - ```bash | ||
| 28 | - +-----------------+---------------------------+ | ||
| 29 | - | name | example | | ||
| 30 | - +-----------------+---------------------------+ | ||
| 31 | - | email | me@example.com (verified) | | ||
| 32 | - +-----------------+---------------------------+ | ||
| 33 | - | two factor auth | auth-and-writes | | ||
| 34 | - +-----------------+---------------------------+ | ||
| 35 | - | fullname | Example User | | ||
| 36 | - +-----------------+---------------------------+ | ||
| 37 | - | homepage | | | ||
| 38 | - +-----------------+---------------------------+ | ||
| 39 | - | freenode | | | ||
| 40 | - +-----------------+---------------------------+ | ||
| 41 | - | twitter | | | ||
| 42 | - +-----------------+---------------------------+ | ||
| 43 | - | github | | | ||
| 44 | - +-----------------+---------------------------+ | ||
| 45 | - | created | 2015-02-26T01:38:35.892Z | | ||
| 46 | - +-----------------+---------------------------+ | ||
| 47 | - | updated | 2017-10-02T21:29:45.922Z | | ||
| 48 | - +-----------------+---------------------------+ | ||
| 27 | + ``` | ||
| 28 | + name: example | ||
| 29 | + email: e@example.com (verified) | ||
| 30 | + two-factor auth: auth-and-writes | ||
| 31 | + fullname: Example User | ||
| 32 | + homepage: | ||
| 33 | + freenode: | ||
| 34 | + twitter: | ||
| 35 | + github: | ||
| 36 | + created: 2015-02-26T01:38:35.892Z | ||
| 37 | + updated: 2017-10-02T21:29:45.922Z | ||
| 49 | 38 | ``` | |
| 50 | 39 | ||
| 51 | 40 | * `npm profile set <property> <value>`: Set the value of a profile | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -7,7 +7,7 @@ description: Search for packages | |||
| 7 | 7 | ### Synopsis | |
| 8 | 8 | ||
| 9 | 9 | ```bash | |
| 10 | - npm search [search terms ...] | ||
| 10 | + npm search <search term> [<search term> ...] | ||
| 11 | 11 | ||
| 12 | 12 | aliases: find, s, se | |
| 13 | 13 | ``` | |
@@ -39,15 +39,6 @@ expression characters in most shells.) | |||
| 39 | 39 | ||
| 40 | 40 | ### Configuration | |
| 41 | 41 | ||
| 42 | - #### `long` | ||
| 43 | - | ||
| 44 | - * Default: false | ||
| 45 | - * Type: Boolean | ||
| 46 | - | ||
| 47 | - Show extended information in `ls`, `search`, and `help-search`. | ||
| 48 | - | ||
| 49 | - | ||
| 50 | - | ||
| 51 | 42 | #### `json` | |
| 52 | 43 | ||
| 53 | 44 | * Default: false | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -22,24 +22,14 @@ This lets you list, create and revoke authentication tokens. | |||
| 22 | 22 | Shows a table of all active authentication tokens. You can request | |
| 23 | 23 | this as JSON with `--json` or tab-separated values with `--parseable`. | |
| 24 | 24 | ||
| 25 | - ```bash | ||
| 26 | - +--------+---------+------------+----------+----------------+ | ||
| 27 | - | id | token | created | read-only | CIDR whitelist | | ||
| 28 | - +--------+---------+------------+----------+----------------+ | ||
| 29 | - | 7f3134 | 1fa9ba… | 2017-10-02 | yes | | | ||
| 30 | - +--------+---------+------------+----------+----------------+ | ||
| 31 | - | c03241 | af7aef… | 2017-10-02 | no | 192.168.0.1/24 | | ||
| 32 | - +--------+---------+------------+----------+----------------+ | ||
| 33 | - | e0cf92 | 3a436a… | 2017-10-02 | no | | | ||
| 34 | - +--------+---------+------------+----------+----------------+ | ||
| 35 | - | 63eb9d | 74ef35… | 2017-09-28 | no | | | ||
| 36 | - +--------+---------+------------+----------+----------------+ | ||
| 37 | - | 2daaa8 | cbad5f… | 2017-09-26 | no | | | ||
| 38 | - +--------+---------+------------+----------+----------------+ | ||
| 39 | - | 68c2fe | 127e51… | 2017-09-23 | no | | | ||
| 40 | - +--------+---------+------------+----------+----------------+ | ||
| 41 | - | 6334e1 | 1dadd1… | 2017-09-23 | no | | | ||
| 42 | - +--------+---------+------------+----------+----------------+ | ||
| 25 | + ``` | ||
| 26 | + Read only token npm_1f… with id 7f3134 created 2017-10-21 | ||
| 27 | + | ||
| 28 | + Publish token npm_af… with id c03241 created 2017-10-02 | ||
| 29 | + with IP Whitelist: 192.168.0.1/24 | ||
| 30 | + | ||
| 31 | + Publish token npm_… with id e0cf92 created 2017-10-02 | ||
| 32 | + | ||
| 43 | 33 | ``` | |
| 44 | 34 | ||
| 45 | 35 | * `npm token create [--read-only] [--cidr=<cidr-ranges>]`: | |
@@ -55,16 +45,8 @@ This lets you list, create and revoke authentication tokens. | |||
| 55 | 45 | website](https://docs.npmjs.com/creating-and-viewing-access-tokens) | |
| 56 | 46 | for more information on generating automation tokens. | |
| 57 | 47 | ||
| 58 | - ```bash | ||
| 59 | - +----------------+--------------------------------------+ | ||
| 60 | - | token | a73c9572-f1b9-8983-983d-ba3ac3cc913d | | ||
| 61 | - +----------------+--------------------------------------+ | ||
| 62 | - | cidr_whitelist | | | ||
| 63 | - +----------------+--------------------------------------+ | ||
| 64 | - | readonly | false | | ||
| 65 | - +----------------+--------------------------------------+ | ||
| 66 | - | created | 2017-10-02T07:52:24.838Z | | ||
| 67 | - +----------------+--------------------------------------+ | ||
| 48 | + ``` | ||
| 49 | + Created publish token a73c9572-f1b9-8983-983d-ba3ac3cc913d | ||
| 68 | 50 | ``` | |
| 69 | 51 | ||
| 70 | 52 | * `npm token revoke <token|id>`: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,7 +14,7 @@ Note: This command is unaware of workspaces. | |||
| 14 | 14 | ||
| 15 | 15 | ### Version | |
| 16 | 16 | ||
| 17 | - 10.5.2 | ||
| 17 | + 10.7.0 | ||
| 18 | 18 | ||
| 19 | 19 | ### Description | |
| 20 | 20 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments