levaliciousandClaude Opus 5.5 b36ff5cdcd [LevK]: Build and test as a standalone package
Split out of actions/toolkit (packages/io, history kept by filter-repo).
Brings the 2024 [LevK] packaging edits forward onto current upstream:

- tsconfig.json: the monorepo root's compiler options inlined, no extends
- jest.config.cjs: the root's ts-jest transform, rooted at tests/
  (isolatedModules: ESM lib/ and sources run through CommonJS)
- __tests__/ -> tests/
- package.json: test = jest, build = tsc; jest/ts-jest/typescript as
  devDependencies; repository, homepage, bugs on git.levk.dev
- .gitignore: node_modules/, lib/, audit.json, tests/_temp/

Not carried over from 2024: version reset to 1.0.0 (dependents' ranges
need upstream's numbering) and the Unlicense field (the code is MIT).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UHXzGrsxfkGk8LmwrBbHNZ
2026-10-12 15:01:22 -04:00
2026-01-28 13:33:17 -05:00
2019-08-21 01:18:21 -04:00

@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']);
S
Description
No description provided
Readme MIT
126 KiB
0 Stars 1 Watchers 0 Forks
Languages
TypeScript 100%