1.0.1 • Published 6 years ago

async-iterators-kit v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

node-async-iterators-kit

License: MIT Build Status

Currently, the package provides a set of async iterators for handling readline, streams, child process stdout and timeouts:

See example:

  const node = cp.spawn('node', ['-p', '2+2'], { stdio: 'pipe' });
  const iterator = new ChildProcessStdioAsyncIterator(node, 'stdout');

  for await (const line of iterator) {
      lines.push(line); // [4]
      break; // sends SIGTERM to the process if it has not exited yet
  }