Skip to content

docs(examples): add advanced patterns example#1231

Closed
vincent067 wants to merge 1 commit intosindresorhus:mainfrom
vincent067:feat/advanced-examples
Closed

docs(examples): add advanced patterns example#1231
vincent067 wants to merge 1 commit intosindresorhus:mainfrom
vincent067:feat/advanced-examples

Conversation

@vincent067
Copy link
Copy Markdown

Hey there! 👋

I've been using execa for a while and really love how powerful it is. While checking out the examples directory, I noticed there wasn't a dedicated example showcasing some of the more advanced features.

This PR adds a new advanced-patterns.js example that demonstrates:

  • 📋 Line-by-line processing - Using the lines option to get array output instead of strings
  • 🔗 Command piping - Chaining commands with .pipe() method
  • 🐛 Verbose mode - Debugging with the verbose option
  • 📜 Script syntax - Using $ for shell-like scripting
  • Error handling - Graceful error handling with detailed info

I've tested it locally and it runs smoothly. The example is also designed to be educational with clear comments explaining each pattern.

Let me know if you'd like any adjustments! Happy to iterate on this. 😊

Changes:

  • Added examples/advanced-patterns.js with 6 demo functions
  • Updated examples/readme.md to include the new example

Add a new example file demonstrating execa's advanced features:
- Line-by-line processing with the 'lines' option
- Command piping with .pipe()
- Verbose mode for debugging
- Script syntax with $
- Graceful error handling

Also update examples readme to include the new example and improve documentation.

This helps users discover and understand execa's more powerful features beyond basic command execution.
@sindresorhus
Copy link
Copy Markdown
Owner

I'm going to close all of this as it's just AI-generated slop seemingly without any human review.

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.

2 participants