Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/01alchemist/launcher
NodeJS Aync Process Launcher
https://github.com/01alchemist/launcher
launcher nodejs process
Last synced: about 2 months ago
JSON representation
NodeJS Aync Process Launcher
- Host: GitHub
- URL: https://github.com/01alchemist/launcher
- Owner: 01alchemist
- License: mit
- Created: 2019-07-29T11:43:47.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-07-11T07:44:53.000Z (6 months ago)
- Last Synced: 2024-11-12T15:06:56.044Z (about 2 months ago)
- Topics: launcher, nodejs, process
- Language: TypeScript
- Homepage:
- Size: 1.34 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nodejs Process Launcher
## Usage
```ts
import {launch} from '@01/launcher'await launch({
cmds:['echo', 'Hello']
})```
## Options
```ts
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