@aibulat/run
v0.0.7
Published
Run a program with env vars specified
Downloads
18
Maintainers
Readme
@aibulat/run
Run a Process with specified ENV vars loaded
Use as CLI
- create a
.env
file - run:
npx @aibulat/run@latest <cmd>
CLI samples:
npx @aibulat/run@latest env
npx @aibulat/run@latest ls -la
npx @aibulat/run@latest cat package.json
npx @aibulat/run@latest mysql -uroot -p
npx @aibulat/run@latest bash
npx @aibulat/run@latest htop
npx @aibulat/run@latest node somescript.js
Use API
import { run } from "@aibulat/run";
const program = "ls";
const args = ["-l", "-a"];
const cmd = run(program, args);
Function Signature
run(program: string, args: string[]): Promise<ChildProcess>
CJS is not supported
tsconfig.json
:
{
"compilerOptions": {
"module": "ES2022",
"moduleResolution": "nodenext"
}
}
package.json
:
{
"type": "module"
}