|
|
@ -1,7 +1,7 @@
|
|
|
|
# An async wrapper for nodejs' `spawn`
|
|
|
|
# An async wrapper for nodejs' `spawn`
|
|
|
|
|
|
|
|
|
|
|
|
```typescript
|
|
|
|
```typescript
|
|
|
|
import { simpleSpawn } from "async-spawner";
|
|
|
|
import simpleSpawn from "async-spawner";
|
|
|
|
await simpleSpawn("ls", ["-al"]);
|
|
|
|
await simpleSpawn("ls", ["-al"]);
|
|
|
|
```
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
@ -12,6 +12,8 @@ let response;
|
|
|
|
do{
|
|
|
|
do{
|
|
|
|
response = await ping.waitForNextData();
|
|
|
|
response = await ping.waitForNextData();
|
|
|
|
console.log("new ping!", response);
|
|
|
|
console.log("new ping!", response);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// you can also write to stdin with ping.write("some string")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ping.kill();
|
|
|
|
ping.kill();
|
|
|
|
```
|
|
|
|
```
|
|
|
|