mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-20 05:40:17 +08:00
2 lines
543 B
TypeScript
2 lines
543 B
TypeScript
import * as Effect from "effect/Effect";import * as ChildProcess from "effect/process/ChildProcess";import * as ChildProcessSpawner from "effect/process/ChildProcessSpawner";import * as NodeServices from "@effect/platform-node/NodeServices";Effect.runPromise((Effect.gen(function*(){const spawner=yield* ChildProcessSpawner.ChildProcessSpawner;return yield* spawner.string(ChildProcess.make("/usr/bin/printf",["hello"]))}).pipe(Effect.provide(NodeServices.layer))).pipe(Effect.tap(value=>Effect.sync(()=>console.log(JSON.stringify(value))))))
|