Socket
Socket
Sign inDemoInstall

@actions/io

Package Overview
Dependencies
0
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @actions/io

Actions io lib


Version published
Weekly downloads
406K
decreased by-11.91%
Maintainers
5
Install size
36.2 kB
Created
Weekly downloads
 

Readme

Source

@actions/io

Core functions for cli filesystem scenarios

Usage

mkdir -p

Recursively make a directory. Follows rules specified in man mkdir with the -p option specified:

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

await io.mkdirP('path/to/make');
cp/mv

Copy or move files or folders. Follows rules specified in man cp and man mv:

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

// Recursive must be true for directories
const options = { recursive: true, force: false }

await io.cp('path/to/directory', 'path/to/dest', options);
await io.mv('path/to/file', 'path/to/dest');
rm -rf

Remove a file or folder recursively. Follows rules specified in man rm with the -r and -f rules specified.

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

await io.rmRF('path/to/directory');
await io.rmRF('path/to/file');
which

Get the path to a tool and resolves via paths. Follows the rules specified in man which.

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

const pythonPath: string = await io.which('python', true)

await exec.exec(`"${pythonPath}"`, ['main.py']);

Keywords

FAQs

Last updated on 15 Mar 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc