Inherited from v1.0.0

exec মডিউল

চাইল্ড প্রসেস spawn। One-shot কমান্ডের জন্য run / run_with_input; stdin/stdout/stderr stream control দরকার হলে spawn

import "exec" as exec;

exec.run("git", ["rev-parse", "HEAD"], function (err, result) {
    if (err != null) { print("git failed:", err); return; }
    print("HEAD:", result.stdout);
});

High-level

ফাংশনবর্ণনা
exec.run(cmd, args, cb)Complete হওয়া পর্যন্ত run; cb(err, { code, stdout, stderr })
exec.run_with_input(cmd, args, input, cb)চাইল্ডের stdin-এ input feed।

Low-level

ফাংশনবর্ণনা
exec.spawn(cmd, args, opts, on_exit) → procচাইল্ড start। opts: {cwd?, env?} বা nullon_exit(code, signal)

Process object

  • proc.pid — চাইল্ড PID।
  • proc.stdin.write(data, cb?), proc.stdin.close()
  • proc.stdout.on_data(fn), proc.stdout.on_end(fn)
  • proc.stderr.on_data(fn), proc.stderr.on_end(fn)
  • proc.kill(sig?) — ডিফল্ট SIGTERM

আরও দেখুন