Created
April 7, 2024 13:09
-
-
Save SaltyAom/c375433ffe7deffdce74db874168ba63 to your computer and use it in GitHub Desktop.
Spawn Bun server using multi-process
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { $ } from 'bun' | |
import { cpus } from 'os' | |
const total = cpus().length - 1 | |
const ops = [] | |
for (let i = 0; i < total; i++) | |
ops.push($`NODE_ENV=production bun example/a.ts`) | |
await Promise.all(ops) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment