温馨提示:本站仅提供公开网络链接索引服务,不存储、不篡改任何第三方内容,所有内容版权归原作者所有
AI智能索引来源:http://www.bun.com/reference/node/child_process/ChildProcessWithoutNullStreams/unref
点击访问原文链接

ChildProcessWithoutNullStreams.unref method | Node.js child_process module | Bun

ChildProcessWithoutNullStreams.unref method | Node.js child_process module | BunBuildDocsReferenceGuidesBlogDiscord/node:child_process/ChildProcessWithoutNullStreams/unrefMunref

Search the reference...

/

BuildDocsReferenceGuidesBlogDiscord/node:child_process/ChildProcessWithoutNullStreams/unrefMunref

method

child_process.ChildProcessWithoutNullStreams.unrefunref(): void;By default, the parent will wait for the detached child to exit. To prevent the parent from waiting for a given subprocess to exit, use the subprocess.unref() method. Doing so will cause the parent's event loop to not include the child in its reference count, allowing the parent to exit independently of the child, unless there is an established IPC channel between the child and the parent.

import { spawn } from 'node:child_process'; const subprocess = spawn(process.argv[0], ['child_program.js'], { detached: true, stdio: 'ignore', }); subprocess.unref();

Resources

ReferenceDocsGuidesDiscordMerch StoreGitHubBlog 

Toolkit

RuntimePackage managerTest runnerBundlerPackage runner

Project

Bun 1.0Bun 1.1Bun 1.2Bun 1.3RoadmapContributingLicenseBaked with ❤️ in San Francisco

We're hiring →

智能索引记录