0.0.7 • Published 1 year ago

@aibulat/run v0.0.7

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

@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"
}