1.0.15 • Published 1 year ago

@01/launcher v1.0.15

Weekly downloads
83
License
LICENSE
Repository
github
Last release
1 year ago

Nodejs Process Launcher

Usage

import {launch} from '@1/launcher'

await launch({
  cmds:['echo', 'Hello']
})

Options

type Options = {
  env?: string | string[];
  cmds?: string[];
  cwd?: string;
  mode?: LaunchMode;
  exitProcessOnClose?: boolean;
  silent?: boolean;
} & SpawnOptions;

env

Option to pass custom environment variable to child process.

  • env:'ENV_VAR=value'
  • env:['ENV1=v1', 'ENV2=v2']
  • env:'ENV1=v1,ENV2=v2'

cmds

Child process cmd with arguments. First element is the program location or name and remaining elements are it's arguments.

cmds: ['echo', 'Hello']

cwd

Current working directory. Path is absolute if it's starts with slash / otherwise relative.

  • cwd: './relative/path'
  • cwd: '/absolute/path'

mode

Launch mode

  • cli Exit program on exceptions
  • program Throw error on exceptions

exitProcessOnClose

Exit parent node process on close.

silent

Skip verbose logs

1.0.15

1 year ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.10

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago