@aibulat/run
TypeScript icon, indicating that this package has built-in type declarations

0.0.7 • Public • Published

@aibulat/run

Run a Process with specified ENV vars loaded

Use as CLI

  1. create a .env file
  2. 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"
}

Package Sidebar

Install

npm i @aibulat/run

Weekly Downloads

2

Version

0.0.7

License

MIT

Unpacked Size

3.66 kB

Total Files

7

Last publish

Collaborators

  • aibulat