1.1.2 • Published 4 years ago

pour-console v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

pour-console

npm version

A simplified promise-based spawn, with real-time logging to console.

Usage

const { pour } = require('pour-console');

(async () => {
  await pour('git switch "non-existent branch"')
  await pour('echo "does not reach here"')  // Will not reach here.
})().catch(console.error)

Deviation from spawn

This project uses shlex to simplify command calling; however you can directly use it without shlex by

await pour([
  'git',
  'commit',
  '-m',
  'long Long commit message'
])

As this also inherits spawn, you can specify cwd by

await pour('git add .', {
  cwd: './dist'
})

Special apps and apps that need Ctrl key

In this case, you'll need to use the good ol' stdio: "inherit".

await pour('nano file.txt', {
  stdio: 'inherit'
})

Installation

yarn add pour-console  # or npm i pour-console

About the name

The name comes from a different package -- std-pour, with quite a similar functionality. But this package is enhanced.

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago