Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@actions/io

Package Overview
Dependencies
Maintainers
5
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@actions/io

Actions io lib

  • 1.1.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.1M
decreased by-13.69%
Maintainers
5
Weekly downloads
 
Created

What is @actions/io?

@actions/io is an npm package designed to provide file system operations for GitHub Actions. It allows you to perform tasks such as copying, moving, and removing files and directories within your GitHub Actions workflows.

What are @actions/io's main functionalities?

Copy Files and Directories

This feature allows you to copy files and directories from one location to another. The code sample demonstrates copying a file from 'source/file.txt' to 'destination/file.txt'.

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

async function copyExample() {
  try {
    await io.cp('source/file.txt', 'destination/file.txt');
    console.log('File copied successfully');
  } catch (error) {
    console.error('Error copying file:', error);
  }
}

copyExample();

Move Files and Directories

This feature allows you to move files and directories from one location to another. The code sample demonstrates moving a file from 'source/file.txt' to 'destination/file.txt'.

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

async function moveExample() {
  try {
    await io.mv('source/file.txt', 'destination/file.txt');
    console.log('File moved successfully');
  } catch (error) {
    console.error('Error moving file:', error);
  }
}

moveExample();

Remove Files and Directories

This feature allows you to remove files and directories. The code sample demonstrates removing a file or directory at 'path/to/file_or_directory'.

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

async function removeExample() {
  try {
    await io.rmRF('path/to/file_or_directory');
    console.log('File or directory removed successfully');
  } catch (error) {
    console.error('Error removing file or directory:', error);
  }
}

removeExample();

Create Directories

This feature allows you to create directories, including any necessary parent directories. The code sample demonstrates creating a directory at 'path/to/new_directory'.

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

async function mkdirExample() {
  try {
    await io.mkdirP('path/to/new_directory');
    console.log('Directory created successfully');
  } catch (error) {
    console.error('Error creating directory:', error);
  }
}

mkdirExample();

Other packages similar to @actions/io

Keywords

FAQs

Package last updated on 15 Mar 2023

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc