|
| 1 | +// benchmark |
| 2 | +conststart=process.hrtime.bigint(); |
| 3 | + |
| 4 | +// start code |
| 5 | +constargs=process.argv.slice(2); |
| 6 | + |
| 7 | +if(args.length===0){ |
| 8 | +console.log(` |
| 9 | +Usage: node find-runtime.mjs <project-folder> |
| 10 | +Find @rescript/runtime directories in a project's node_modules. |
| 11 | +Arguments: |
| 12 | + project-folder Path to the project directory to search |
| 13 | +Examples: |
| 14 | + node find-runtime.mjs /path/to/project |
| 15 | + node find-runtime.mjs . |
| 16 | +`); |
| 17 | +process.exit(1); |
| 18 | +} |
| 19 | + |
| 20 | +constproject=args[args.length-1]; |
| 21 | + |
| 22 | +import{findRuntime}from"../server/src/find-runtime.ts"; |
| 23 | + |
| 24 | +construntimes=awaitfindRuntime(project); |
| 25 | + |
| 26 | +console.log("Found @rescript/runtime directories:",runtimes); |
| 27 | + |
| 28 | +// end code |
| 29 | +constend=process.hrtime.bigint(); |
| 30 | +constdurationMs=Number(end-start)/1e6;// convert ns → ms |
| 31 | + |
| 32 | +console.log(`Script took${durationMs.toFixed(3)}ms`); |