UNPKG

just-scripts

Version:
46 lines 1.78 kB
/// <reference types="node" /> import { SpawnOptions } from 'child_process'; import { TaskFunction } from 'just-task'; export interface NodeExecTaskOptions { /** * Arguments to be passed into a spawn call, including the script path to execute. * The script path should be **absolute** to prevent unpredictable resolution. * * **WARNING: If `options.shell` is enabled, do not pass unsanitized user input as `args`. * Any input containing shell metacharacters may be used to trigger arbitrary command execution.** */ args: string[]; /** * Environment variables to be passed to the spawned process. * Defaults to `process.env`. */ env?: NodeJS.ProcessEnv; /** * Whether to use `ts-node` to execute the script */ enableTypeScript?: boolean; /** * tsconfig file path to pass to `ts-node` */ tsconfig?: string; /** * Whether to use `transpileOnly` mode for `ts-node` */ transpileOnly?: boolean; /** * Custom spawn options. * * **WARNING: If the `shell` option is enabled, do not pass unsanitized user input as `args`. * Any input containing shell metacharacters may be used to trigger arbitrary command execution.** */ spawnOptions?: SpawnOptions; } /** * Create a task to execute a command in a new process. * Uses `cross-spawn` to avoid issues with spaces in arguments, but does not do any additional escaping. * * **WARNING: If the `shell` option is enabled, do not pass unsanitized user input to this task. * Any input containing shell metacharacters may be used to trigger arbitrary command execution.** */ export declare function nodeExecTask(options: NodeExecTaskOptions): TaskFunction; //# sourceMappingURL=nodeExecTask.d.ts.map