21 lines
574 B
TypeScript
21 lines
574 B
TypeScript
import { spawnSync } from 'node:child_process';
|
|
|
|
const code = `import { App } from '@kevisual/router';
|
|
const app = new App();
|
|
console.log('App initialized:', app.appId);
|
|
`
|
|
// const child = Bun.spawn({
|
|
// cmd: ["bun", "--eval", "console.log('from child process')"],
|
|
// stdio: ["pipe", "pipe", "inherit"]
|
|
// });
|
|
|
|
const child = Bun.spawn({
|
|
cmd: ["bun", "--eval", code],
|
|
env: {},
|
|
stdio: ["pipe", "pipe", "inherit"]
|
|
});
|
|
|
|
const output = await new Response(child.stdout).text();
|
|
console.log('Child process output:', output);
|
|
|
|
console.log('Child process PID:', child.pid); |