@actions/exec
Actions exec lib
Last updated 7 years ago by jclem .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @actions/exec 
SYNC missed versions from official npm registry.

@actions/exec

Usage

Basic

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

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

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

Args

You can also pass in arg arrays:

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

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

Output/options

Capture output or specify other options:

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:

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

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

Current Tags

  • 3.0.0                                ...           latest (2 months ago)

9 Versions

  • 3.0.0                                ...           2 months ago
  • 2.0.0                                ...           4 months ago
  • 1.1.1                                ...           4 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.4                                ...           6 years ago
  • 1.0.3                                ...           6 years ago
  • 1.0.2                                ...           6 years ago
  • 1.0.1                                ...           7 years ago
  • 1.0.0                                ...           7 years ago
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 1
Last Month 0
Dependencies (0)
None
Dev Dependencies (1)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |