Skip to main content
Home

Built and signed on GitHub Actions

latest

Use tinyexec process as structurally safe Effection resource.

This package works with Node.js, Deno, BunIt is unknown whether this package works with Cloudflare Workers, Browsers
It is unknown whether this package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
It is unknown whether this package works with Browsers
JSR Score
100%
Published
3 months ago (0.1.2)

tinyexec

Effection compatible wrapper around tinyexec package.


To run a process, use the x function:

import { x } from "@effectionx/tinyexec";
import { each, main } from "effection";

await main(function* () {
  let proc = yield* x("echo", ["Hello, World"]);

  for (let line of yield* each(proc.lines)) {
    console.log(line);
    yield* each.next();
  }
});
// => prints "Hello, World"

The process will be automatically destroyed whenever it passes out of scope. For example, the following shows the output of the top command for five seconds before exiting.

import { x } from "@effectionx/tinyexec";
import { each, main, sleep, spawn } from "effection";

await main(function* () {
  yield* spawn(function* () {
    let proc = yield* x("top");

    for (let line of yield* each(proc.lines)) {
      console.log(line);
      yield* each.next();
    }
  });

  yield* sleep(5000);
});
Built and signed on
GitHub Actions

New Ticket: Report package

Please provide a reason for reporting this package. We will review your report and take appropriate action.

Please review the JSR usage policy before submitting a report.

Add Package

deno add jsr:@effectionx/tinyexec

Import symbol

import * as tinyexec from "@effectionx/tinyexec";
or

Import directly with a jsr specifier

import * as tinyexec from "jsr:@effectionx/tinyexec";

Add Package

pnpm i jsr:@effectionx/tinyexec
or (using pnpm 10.8 or older)
pnpm dlx jsr add @effectionx/tinyexec

Import symbol

import * as tinyexec from "@effectionx/tinyexec";

Add Package

yarn add jsr:@effectionx/tinyexec
or (using Yarn 4.8 or older)
yarn dlx jsr add @effectionx/tinyexec

Import symbol

import * as tinyexec from "@effectionx/tinyexec";

Add Package

vlt install jsr:@effectionx/tinyexec

Import symbol

import * as tinyexec from "@effectionx/tinyexec";

Add Package

npx jsr add @effectionx/tinyexec

Import symbol

import * as tinyexec from "@effectionx/tinyexec";

Add Package

bunx jsr add @effectionx/tinyexec

Import symbol

import * as tinyexec from "@effectionx/tinyexec";