| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 18dc03d commit cf82adf
11 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1577,7 +1577,7 @@ querystring.parse(str, '\n', '='); | |||
| 1577 | 1577 | This function is not completely equivalent to `querystring.parse()`. One | |
| 1578 | 1578 | difference is that `querystring.parse()` does url decoding: | |
| 1579 | 1579 | ||
| 1580 | - ```sh | ||
| 1580 | + ```console | ||
| 1581 | 1581 | > querystring.parse('%E5%A5%BD=1', '\n', '='); | |
| 1582 | 1582 | { '好': '1' } | |
| 1583 | 1583 | > tls.parseCertString('%E5%A5%BD=1'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -94,7 +94,7 @@ until the root of the volume is reached. | |||
| 94 | 94 | } | |
| 95 | 95 | ``` | |
| 96 | 96 | ||
| 97 | - ```sh | ||
| 97 | + ```bash | ||
| 98 | 98 | # In same folder as above package.json | |
| 99 | 99 | node my-app.js # Runs as ES module | |
| 100 | 100 | ``` | |
@@ -184,7 +184,7 @@ Strings passed in as an argument to `--eval` or `--print` (or `-e` or `-p`), or | |||
| 184 | 184 | piped to `node` via `STDIN`, will be treated as ES modules when the | |
| 185 | 185 | `--input-type=module` flag is set. | |
| 186 | 186 | ||
| 187 | - ```sh | ||
| 187 | + ```bash | ||
| 188 | 188 | node --input-type=module --eval "import { sep } from 'path'; console.log(sep);" | |
| 189 | 189 | ||
| 190 | 190 | echo "import { sep } from 'path'; console.log(sep);" | node --input-type=module | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -680,7 +680,7 @@ In `entry.js` script: | |||
| 680 | 680 | console.log(require.main); | |
| 681 | 681 | ``` | |
| 682 | 682 | ||
| 683 | - ```sh | ||
| 683 | + ```bash | ||
| 684 | 684 | node entry.js | |
| 685 | 685 | ``` | |
| 686 | 686 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,7 +31,7 @@ when loading modules. | |||
| 31 | 31 | Once this has been set, all modules must conform to a policy manifest file | |
| 32 | 32 | passed to the flag: | |
| 33 | 33 | ||
| 34 | - ```sh | ||
| 34 | + ```bash | ||
| 35 | 35 | node --experimental-policy=policy.json app.js | |
| 36 | 36 | ``` | |
| 37 | 37 | ||
@@ -43,7 +43,7 @@ the policy file itself may be provided via `--policy-integrity`. | |||
| 43 | 43 | This allows running `node` and asserting the policy file contents | |
| 44 | 44 | even if the file is changed on disk. | |
| 45 | 45 | ||
| 46 | - ```sh | ||
| 46 | + ```bash | ||
| 47 | 47 | node --experimental-policy=policy.json --policy-integrity="sha384-SggXRQHwCG8g+DktYYzxkXRIkTiEYWBHqev0xnpCxYlqMBufKZHAHQM3/boDaI/0" app.js | |
| 48 | 48 | ``` | |
| 49 | 49 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -21,7 +21,7 @@ Private keys can be generated in multiple ways. The example below illustrates | |||
| 21 | 21 | use of the OpenSSL command-line interface to generate a 2048-bit RSA private | |
| 22 | 22 | key: | |
| 23 | 23 | ||
| 24 | - ```sh | ||
| 24 | + ```bash | ||
| 25 | 25 | openssl genrsa -out ryans-key.pem 2048 | |
| 26 | 26 | ``` | |
| 27 | 27 | ||
@@ -35,7 +35,7 @@ step to obtaining a certificate is to create a *Certificate Signing Request* | |||
| 35 | 35 | The OpenSSL command-line interface can be used to generate a CSR for a private | |
| 36 | 36 | key: | |
| 37 | 37 | ||
| 38 | - ```sh | ||
| 38 | + ```bash | ||
| 39 | 39 | openssl req -new -sha256 -key ryans-key.pem -out ryans-csr.pem | |
| 40 | 40 | ``` | |
| 41 | 41 | ||
@@ -45,14 +45,14 @@ Authority for signing or used to generate a self-signed certificate. | |||
| 45 | 45 | Creating a self-signed certificate using the OpenSSL command-line interface | |
| 46 | 46 | is illustrated in the example below: | |
| 47 | 47 | ||
| 48 | - ```sh | ||
| 48 | + ```bash | ||
| 49 | 49 | openssl x509 -req -in ryans-csr.pem -signkey ryans-key.pem -out ryans-cert.pem | |
| 50 | 50 | ``` | |
| 51 | 51 | ||
| 52 | 52 | Once the certificate is generated, it can be used to generate a `.pfx` or | |
| 53 | 53 | `.p12` file: | |
| 54 | 54 | ||
| 55 | - ```sh | ||
| 55 | + ```bash | ||
| 56 | 56 | openssl pkcs12 -export -in ryans-cert.pem -inkey ryans-key.pem \ | |
| 57 | 57 | -certfile ca-cert.pem -out ryans.pfx | |
| 58 | 58 | ``` | |
@@ -95,7 +95,7 @@ to generate Diffie-Hellman parameters and specify them with the `dhparam` | |||
| 95 | 95 | option to [`tls.createSecureContext()`][]. The following illustrates the use of | |
| 96 | 96 | the OpenSSL command-line interface to generate such parameters: | |
| 97 | 97 | ||
| 98 | - ```sh | ||
| 98 | + ```bash | ||
| 99 | 99 | openssl dhparam -outform PEM -out dhparam.pem 2048 | |
| 100 | 100 | ``` | |
| 101 | 101 | ||
@@ -254,7 +254,7 @@ failures, it is easy to not notice unnecessarily poor TLS performance. The | |||
| 254 | 254 | OpenSSL CLI can be used to verify that servers are resuming sessions. Use the | |
| 255 | 255 | `-reconnect` option to `openssl s_client`, for example: | |
| 256 | 256 | ||
| 257 | - ```sh | ||
| 257 | + ```console | ||
| 258 | 258 | $ openssl s_client -connect localhost:443 -reconnect | |
| 259 | 259 | ``` | |
| 260 | 260 | ||
@@ -308,7 +308,7 @@ line switch (directly, or via the [`NODE_OPTIONS`][] environment variable). For | |||
| 308 | 308 | instance, the following makes `ECDHE-RSA-AES128-GCM-SHA256:!RC4` the default TLS | |
| 309 | 309 | cipher suite: | |
| 310 | 310 | ||
| 311 | - ```sh | ||
| 311 | + ```bash | ||
| 312 | 312 | node --tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256:!RC4" server.js | |
| 313 | 313 | ||
| 314 | 314 | export NODE_OPTIONS=--tls-cipher-list="ECDHE-RSA-AES128-GCM-SHA256:!RC4" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,7 +19,7 @@ default be instances of `tty.WriteStream`. The preferred method of determining | |||
| 19 | 19 | whether Node.js is being run within a TTY context is to check that the value of | |
| 20 | 20 | the `process.stdout.isTTY` property is `true`: | |
| 21 | 21 | ||
| 22 | - ```sh | ||
| 22 | + ```console | ||
| 23 | 23 | $ node -p -e "Boolean(process.stdout.isTTY)" | |
| 24 | 24 | true | |
| 25 | 25 | $ node -p -e "Boolean(process.stdout.isTTY)" | cat | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -638,7 +638,7 @@ That means a commit has landed since your last rebase against `upstream/master`. | |||
| 638 | 638 | To fix this, pull with rebase from upstream, run the tests again, and (if the | |
| 639 | 639 | tests pass) push again: | |
| 640 | 640 | ||
| 641 | - ```sh | ||
| 641 | + ```bash | ||
| 642 | 642 | git pull upstream master --rebase | |
| 643 | 643 | make -j4 test | |
| 644 | 644 | git push upstream master | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ This document describes how to update `deps/openssl/`. | |||
| 10 | 10 | ||
| 11 | 11 | ## 0. Check Requirements | |
| 12 | 12 | ||
| 13 | - ```sh | ||
| 13 | + ```console | ||
| 14 | 14 | % perl -v | |
| 15 | 15 | ||
| 16 | 16 | This is perl 5, version 22, subversion 1 (v5.22.1) built for | |
@@ -30,7 +30,7 @@ NASM version 2.11.08 | |||
| 30 | 30 | Get a new source from <https://www.openssl.org/source/> and extract | |
| 31 | 31 | all files into `deps/openssl/openssl`. Then add all files and commit | |
| 32 | 32 | them. | |
| 33 | - ```sh | ||
| 33 | + ```console | ||
| 34 | 34 | % cd deps/openssl/ | |
| 35 | 35 | % rm -rf openssl | |
| 36 | 36 | % tar zxf ~/tmp/openssl-1.1.0h.tar.gz | |
@@ -57,7 +57,7 @@ This updates all sources in deps/openssl/openssl by: | |||
| 57 | 57 | ||
| 58 | 58 | Use `make` to regenerate all platform dependent files in | |
| 59 | 59 | `deps/openssl/config/archs/`: | |
| 60 | - ```sh | ||
| 60 | + ```console | ||
| 61 | 61 | % make -C deps/openssl/config | |
| 62 | 62 | ``` | |
| 63 | 63 | ||
@@ -66,7 +66,7 @@ Use `make` to regenerate all platform dependent files in | |||
| 66 | 66 | Check diffs to ensure updates are right. Even if there are no updates in openssl | |
| 67 | 67 | sources, `buildinf.h` files will be updated because they have timestamp | |
| 68 | 68 | data in them. | |
| 69 | - ```sh | ||
| 69 | + ```console | ||
| 70 | 70 | % git diff -- deps/openssl | |
| 71 | 71 | ``` | |
| 72 | 72 | ||
@@ -81,7 +81,7 @@ please ask @shigeki for details. | |||
| 81 | 81 | ||
| 82 | 82 | Update all architecture dependent files. Do not forget to git add or remove | |
| 83 | 83 | files if they are changed before committing: | |
| 84 | - ```sh | ||
| 84 | + ```console | ||
| 85 | 85 | % git add deps/openssl/config/archs | |
| 86 | 86 | % git add deps/openssl/openssl/include/crypto/bn_conf.h | |
| 87 | 87 | % git add deps/openssl/openssl/include/crypto/dso_conf.h | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ request. | |||
| 37 | 37 | * A breaking change helper | |
| 38 | 38 | ([full source](https://gist.github.com/chrisdickinson/ba532fa0e4e243fb7b44)): | |
| 39 | 39 | ||
| 40 | - ```sh | ||
| 40 | + ```bash | ||
| 41 | 41 | SHOW=$(git show-ref -d $(git describe --abbrev=0) | tail -n1 | awk '{print $1}') | |
| 42 | 42 | git checkout $(git show -s --pretty='%T' $SHOW) -- test | |
| 43 | 43 | make -j4 test | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -576,22 +576,22 @@ same GPG key!** | |||
| 576 | 576 | Use `tools/release.sh` to promote and sign the build. Before doing this, you'll | |
| 577 | 577 | need to ensure you've loaded the correct ssh key, or you'll see the following: | |
| 578 | 578 | ||
| 579 | - ```sh | ||
| 579 | + ```console | ||
| 580 | 580 | # Checking for releases ... | |
| 581 | 581 | Enter passphrase for key '/Users/<user>/.ssh/id_rsa': | |
| 582 | 582 | dist@direct.nodejs.org's password: | |
| 583 | 583 | ``` | |
| 584 | 584 | ||
| 585 | 585 | The key can be loaded either with `ssh-add`: | |
| 586 | 586 | ||
| 587 | - ```sh | ||
| 587 | + ```console | ||
| 588 | 588 | # Substitute node_id_rsa with whatever you've named the key | |
| 589 | 589 | $ ssh-add ~/.ssh/node_id_rsa | |
| 590 | 590 | ``` | |
| 591 | 591 | ||
| 592 | 592 | or at runtime with: | |
| 593 | 593 | ||
| 594 | - ```sh | ||
| 594 | + ```console | ||
| 595 | 595 | # Substitute node_id_rsa with whatever you've named the key | |
| 596 | 596 | $ ./tools/release.sh -i ~/.ssh/node_id_rsa | |
| 597 | 597 | ``` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments