Files
scriptc/tests/fixtures/effect4/node-process.ts

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))))))