| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 893e2cf commit ad86a12
219 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,8 +41,9 @@ if [ $? -ne 0 ]; then | |||
| 41 | 41 | fi | |
| 42 | 42 | no_node_dir | |
| 43 | 43 | fi | |
| 44 | + NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js" | ||
| 44 | 45 | NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js" | |
| 45 | - NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` | ||
| 46 | + NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"` | ||
| 46 | 47 | if [ $? -ne 0 ]; then | |
| 47 | 48 | no_node_dir | |
| 48 | 49 | fi | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,30 @@ | |||
| 1 | + #!/usr/bin/env node | ||
| 2 | + // This is a single-use bin to help windows discover the proper prefix for npm | ||
| 3 | + // without having to load all of npm first | ||
| 4 | + // It does not accept argv params | ||
| 5 | + | ||
| 6 | + const path = require('path') | ||
| 7 | + const Config = require('@npmcli/config') | ||
| 8 | + const { definitions, flatten, shorthands } = require('@npmcli/config/lib/definitions') | ||
| 9 | + const config = new Config({ | ||
| 10 | + npmPath: path.dirname(__dirname), | ||
| 11 | + // argv is explicitly not looked at since prefix is not something that can be changed via argv | ||
| 12 | + argv: [], | ||
| 13 | + definitions, | ||
| 14 | + flatten, | ||
| 15 | + shorthands, | ||
| 16 | + excludeNpmCwd: false, | ||
| 17 | + }) | ||
| 18 | + | ||
| 19 | + async function main () { | ||
| 20 | + try { | ||
| 21 | + await config.load() | ||
| 22 | + // eslint-disable-next-line no-console | ||
| 23 | + console.log(config.globalPrefix) | ||
| 24 | + } catch (err) { | ||
| 25 | + // eslint-disable-next-line no-console | ||
| 26 | + console.error(err) | ||
| 27 | + process.exit(1) | ||
| 28 | + } | ||
| 29 | + } | ||
| 30 | + main() | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,8 +8,9 @@ IF NOT EXIST "%NODE_EXE%" ( | |||
| 8 | 8 | SET "NODE_EXE=node" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | + SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js" | ||
| 11 | 12 | SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" | |
| 12 | - FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( | ||
| 13 | + FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO ( | ||
| 13 | 14 | SET "NPM_PREFIX_NPM_CLI_JS=%%F\node_modules\npm\bin\npm-cli.js" | |
| 14 | 15 | ) | |
| 15 | 16 | IF EXIST "%NPM_PREFIX_NPM_CLI_JS%" ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,8 +17,8 @@ if ($nodebin -eq $null) { | |||
| 17 | 17 | } | |
| 18 | 18 | $nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path | |
| 19 | 19 | ||
| 20 | - $npmclijs="$nodedir/node_modules/npm/bin/npm-cli.js" | ||
| 21 | - $npmprefix=(& $nodeexe $npmclijs prefix -g) | ||
| 20 | + $npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js" | ||
| 21 | + $npmprefix=(& $nodeexe $npmprefixjs) | ||
| 22 | 22 | if ($LASTEXITCODE -ne 0) { | |
| 23 | 23 | Write-Host "Could not determine Node.js install directory" | |
| 24 | 24 | exit 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -41,9 +41,9 @@ if [ $? -ne 0 ]; then | |||
| 41 | 41 | fi | |
| 42 | 42 | no_node_dir | |
| 43 | 43 | fi | |
| 44 | - NPM_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-cli.js" | ||
| 44 | + NPM_PREFIX_JS="$CLI_BASEDIR/node_modules/npm/bin/npm-prefix.js" | ||
| 45 | 45 | NPX_CLI_JS="$CLI_BASEDIR/node_modules/npm/bin/npx-cli.js" | |
| 46 | - NPM_PREFIX=`"$NODE_EXE" "$NPM_CLI_JS" prefix -g` | ||
| 46 | + NPM_PREFIX=`"$NODE_EXE" "$NPM_PREFIX_JS"` | ||
| 47 | 47 | if [ $? -ne 0 ]; then | |
| 48 | 48 | no_node_dir | |
| 49 | 49 | fi | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,9 +8,9 @@ IF NOT EXIST "%NODE_EXE%" ( | |||
| 8 | 8 | SET "NODE_EXE=node" | |
| 9 | 9 | ) | |
| 10 | 10 | ||
| 11 | - SET "NPM_CLI_JS=%~dp0\node_modules\npm\bin\npm-cli.js" | ||
| 11 | + SET "NPM_PREFIX_JS=%~dp0\node_modules\npm\bin\npm-prefix.js" | ||
| 12 | 12 | SET "NPX_CLI_JS=%~dp0\node_modules\npm\bin\npx-cli.js" | |
| 13 | - FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_CLI_JS%" prefix -g') DO ( | ||
| 13 | + FOR /F "delims=" %%F IN ('CALL "%NODE_EXE%" "%NPM_PREFIX_JS%"') DO ( | ||
| 14 | 14 | SET "NPM_PREFIX_NPX_CLI_JS=%%F\node_modules\npm\bin\npx-cli.js" | |
| 15 | 15 | ) | |
| 16 | 16 | IF EXIST "%NPM_PREFIX_NPX_CLI_JS%" ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,8 +17,8 @@ if ($nodebin -eq $null) { | |||
| 17 | 17 | } | |
| 18 | 18 | $nodedir = $(New-Object -ComObject Scripting.FileSystemObject).GetFile("$nodebin").ParentFolder.Path | |
| 19 | 19 | ||
| 20 | - $npmclijs="$nodedir/node_modules/npm/bin/npm-cli.js" | ||
| 21 | - $npmprefix=(& $nodeexe $npmclijs prefix -g) | ||
| 20 | + $npmprefixjs="$nodedir/node_modules/npm/bin/npm-prefix.js" | ||
| 21 | + $npmprefix=(& $nodeexe $npmprefixjs) | ||
| 22 | 22 | if ($LASTEXITCODE -ne 0) { | |
| 23 | 23 | Write-Host "Could not determine Node.js install directory" | |
| 24 | 24 | exit 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -49,6 +49,13 @@ Registry signatures can be verified using the following `audit` command: | |||
| 49 | 49 | $ npm audit signatures | |
| 50 | 50 | ``` | |
| 51 | 51 | ||
| 52 | + The `audit signatures` command will also verify the provenance attestations of | ||
| 53 | + downloaded packages. Because provenance attestations are such a new feature, | ||
| 54 | + security features may be added to (or changed in) the attestation format over | ||
| 55 | + time. To ensure that you're always able to verify attestation signatures check | ||
| 56 | + that you're running the latest version of the npm CLI. Please note this often | ||
| 57 | + means updating npm beyond the version that ships with Node.js. | ||
| 58 | + | ||
| 52 | 59 | The npm CLI supports registry signatures and signing keys provided by any registry if the following conventions are followed: | |
| 53 | 60 | ||
| 54 | 61 | 1. Signatures are provided in the package's `packument` in each published version within the `dist` object: | |
@@ -89,7 +96,7 @@ Keys response: | |||
| 89 | 96 | - `scheme`: only `ecdsa-sha2-nistp256` is currently supported by the npm CLI | |
| 90 | 97 | - `key`: base64 encoded public key | |
| 91 | 98 | ||
| 92 | - See this [example key's response from the public npm registry](https://registry.npmjs.org/-/npm/v1/keys"). | ||
| 99 | + See this [example key's response from the public npm registry](https://registry.npmjs.org/-/npm/v1/keys). | ||
| 93 | 100 | ||
| 94 | 101 | ### Audit Endpoints | |
| 95 | 102 | ||
| 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.0 /path/to/npm | ||
| 30 | + npm@10.5.1 /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 | |
|---|---|---|---|
@@ -91,6 +91,16 @@ Show the description in `npm search` | |||
| 91 | 91 | ||
| 92 | 92 | ||
| 93 | 93 | ||
| 94 | + #### `searchlimit` | ||
| 95 | + | ||
| 96 | + * Default: 20 | ||
| 97 | + * Type: Number | ||
| 98 | + | ||
| 99 | + Number of items to limit search results to. Will not apply at all to legacy | ||
| 100 | + searches. | ||
| 101 | + | ||
| 102 | + | ||
| 103 | + | ||
| 94 | 104 | #### `searchopts` | |
| 95 | 105 | ||
| 96 | 106 | * Default: "" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments