MCPcopy
hub / github.com/nestjs/nest / printHelpAndExit

Function printHelpAndExit

tools/benchmarks/src/main.ts:82–106  ·  view source on GitHub ↗
(code: number)

Source from the content-addressed store, hash-verified

80}
81
82function printHelpAndExit(code: number): never {
83 // Keep this simple so `npm run benchmarks` works without extra args.
84 // Tuning: `--connections`, `--duration`, `--pipelining`, `--port`, `--path`
85 // Notes: The benchmark spawns the framework server as a child process and
86 // runs autocannon against it.
87 //
88 // eslint-disable-next-line no-console
89 console.log(
90 `
91Usage:
92 npm run benchmarks [-- --verbose]
93 npm run benchmarks [-- --connections 100] [-- --duration 10] [-- --pipelining 10]
94 npm run benchmarks [-- --port 3000] [-- --path /]
95
96Defaults:
97 verbose: ${DEFAULTS.verbose}
98 connections: ${DEFAULTS.connections}
99 duration: ${DEFAULTS.duration}
100 pipelining: ${DEFAULTS.pipelining}
101 port: ${DEFAULTS.port}
102 path: ${DEFAULTS.path}
103`.trim(),
104 );
105 process.exit(code);
106}
107
108function frameworkEntry(framework: Framework): string {
109 return join(__dirname, '.', 'frameworks', framework);

Callers 1

parseArgsFunction · 0.85

Calls 1

logMethod · 0.65

Tested by

no test coverage detected