| 201 | } |
| 202 | |
| 203 | function print(stream) { |
| 204 | const { options, aliases } = getCLIOptionsInfo(); |
| 205 | const console = require('internal/console/global'); |
| 206 | |
| 207 | // Use 75 % of the available width, and at least 70 characters. |
| 208 | const width = MathMax(70, (stream.columns || 0) * 0.75); |
| 209 | const firstColumn = MathFloor(width * 0.4); |
| 210 | const secondColumn = MathFloor(width * 0.57); |
| 211 | |
| 212 | options.set('-', { helpText: 'script read from stdin ' + |
| 213 | '(default if no file name is provided, ' + |
| 214 | 'interactive mode if a tty)' }); |
| 215 | options.set('--', { helpText: 'indicate the end of node options' }); |
| 216 | let helpText = ( |
| 217 | 'Usage: node [options] [ script.js ] [arguments]\n' + |
| 218 | ' node inspect [options] [ script.js | host:port ] [arguments]\n\n' + |
| 219 | 'Options:\n'); |
| 220 | helpText += (indent(format({ |
| 221 | options, aliases, firstColumn, secondColumn, |
| 222 | }), 2)); |
| 223 | |
| 224 | helpText += ('\nEnvironment variables:\n'); |
| 225 | |
| 226 | helpText += (format({ |
| 227 | options: envVars, firstColumn, secondColumn, |
| 228 | })); |
| 229 | |
| 230 | helpText += ('\nDocumentation can be found at https://nodejs.org/'); |
| 231 | console.log(helpText); |
| 232 | } |
| 233 | |
| 234 | prepareMainThreadExecution(); |
| 235 | |