Skip to content

.pipe() shortcut for $ - #840

Merged
sindresorhus merged 4 commits into
mainfrom
script-pipe
Feb 23, 2024
Merged

sindresorhus merged 4 commits into
mainfrom
script-pipe

Conversation

@ehmicky

@ehmicky ehmicky commented Feb 22, 2024 •

Copy link
Copy Markdown
Collaborator

Fixes #797.

This adds a shortcut syntax so that users can turn this:

const {stdout} = await $({preferLocal: true})`npm run docs`
  .pipe($({stdin: 'pipe'})($`grep ${message}`))
  .pipe($({stdin: 'pipe'})($`sort`))
  .pipe($({stdin: 'pipe', lines: true})($`head -n ${count}`), {signal});

Into this instead:

const {stdout} = await $({preferLocal: true})`npm run docs`
  .pipe`grep ${message}`
  .pipe`sort`
  .pipe({lines: true, signal})`head -n ${count}`;

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.pipe() shortcut with $

3 participants