You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
437 B
Markdown
20 lines
437 B
Markdown
# An async wrapper for nodejs' `spawn`
|
|
|
|
```typescript
|
|
import simpleSpawn from "async-spawner";
|
|
await simpleSpawn("ls", ["-al"]);
|
|
```
|
|
|
|
```typescript
|
|
import { deferedSpawn } from "async-spawner";
|
|
const ping = await deferedSpawn("ping", ["8.8.8.8"]);
|
|
let response;
|
|
do{
|
|
response = await ping.waitForNextData();
|
|
console.log("new ping!", response);
|
|
|
|
// you can also write to stdin with ping.write("some string")
|
|
}
|
|
ping.kill();
|
|
```
|