# @actions/exec

> Actions exec lib

Latest version **3.0.0** (published 2026-01-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @actions/exec
pnpm add @actions/exec
yarn add @actions/exec
bun add @actions/exec
```

## Health

**Score 70/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2026-01-28 |
| First published | 2019-08-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 52.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 5858 |
| Maintainers | chrispat, bryanmacfarlane, thboop, konradpabjan, cschleiden, bdehamer, joshmgross |
| Keywords | github, actions, exec |

## Links

- npm: https://www.npmjs.com/package/@actions/exec
- Repository: https://github.com/actions/toolkit
- Homepage: https://github.com/actions/toolkit/tree/main/packages/exec
- Issues: https://github.com/actions/toolkit/issues
- npm.io page: https://npm.io/package/@actions/exec

## Dependencies (1)

- [@actions/io](https://npm.io/package/@actions/io.md) ^3.0.2

## Recent versions

- 3.0.0 (latest) — 2026-01-28
- 2.0.0 — 2025-12-09
- 1.1.1 — 2022-03-17
- 1.1.0 — 2021-06-07
- 1.0.4 — 2020-04-28
- 1.0.3 — 2020-01-10
- 1.0.2 — 2019-12-09
- 1.0.1 — 2019-09-05
- 1.0.0 — 2019-08-07

## README

# `@actions/exec`

## Usage

#### Basic

You can use this package to execute tools in a cross platform way:

```js
const exec = require('@actions/exec');

await exec.exec('node index.js');
```

#### Args

You can also pass in arg arrays:

```js
const exec = require('@actions/exec');

await exec.exec('node', ['index.js', 'foo=bar']);
```

#### Output/options

Capture output or specify [other options](https://github.com/actions/toolkit/blob/d9347d4ab99fd507c0b9104b2cf79fb44fcc827d/packages/exec/src/interfaces.ts#L5):

```js
const exec = require('@actions/exec');

let myOutput = '';
let myError = '';

const options = {};
options.listeners = {
  stdout: (data: Buffer) => {
    myOutput += data.toString();
  },
  stderr: (data: Buffer) => {
    myError += data.toString();
  }
};
options.cwd = './lib';

await exec.exec('node', ['index.js', 'foo=bar'], options);
```

#### Exec tools not in the PATH

You can specify the full path for tools not in the PATH:

```js
const exec = require('@actions/exec');

await exec.exec('"/path/to/my-tool"', ['arg1']);
```

---
_Source: https://npm.io/package/@actions/exec · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
