t-comm
Version:
专业、稳定、纯粹的工具库
18 lines (17 loc) • 514 B
TypeScript
/// <reference types="node" />
import type * as childProcess from 'child_process';
/**
* 获取 Node.js child_process 模块(仅支持 Node.js 环境)
* @returns child_process 模块
* @throws {Error} 当在非 Node.js 环境中调用时抛出错误
* @example
* ```ts
* const cp = getChildProcess();
* cp.exec('ls -la', (error, stdout, stderr) => {
* console.log(stdout);
* });
* ```
*/
export declare function getChildProcess(): ChildProcess;
type ChildProcess = typeof childProcess;
export {};