You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the discussion, participants are exploring how to handle input from a pipe operator in a TypeScript CLI application using the Effect library. Key points include:
Standard Input (stdin): Typically accessed in Node.js via process.stdin. The library possibly has utilities for handling input but lacks direct support for streaming stdin continuously.
Arguments (Args) and stdin: The traditional way of parsing command line options doesn't directly support piping input as arguments.
Proposal for Enhancement:
Introduce an Arg combinator that can handle stdin as if it were an argument.
Consider using a symbol like - to indicate reading from stdin, mimicking conventions from other CLI tools.
Explore using Streams in conjunction with Args, allowing a stream from stdin to be treated as part of the argument parsing process.
Challenges and Considerations:
Handling streaming input could potentially cause a program to hang if it waits indefinitely for input.
Designing a system where the application decides how to process the potentially streaming data.
Implementation Ideas:
Introduce a method to declare Args that can incorporate stdin, possibly resulting in a Stream<string>.
Such features could be beneficial for processing command-line arguments intended to handle multiple inputs or streaming content.
The conversation involves contributions from several community members, considering both current limitations and potential enhancements to better handle piped input in CLI applications.
Summary
In the discussion, participants are exploring how to handle input from a pipe operator in a TypeScript CLI application using the Effect library. Key points include:
Standard Input (stdin): Typically accessed in Node.js via
process.stdin
. The library possibly has utilities for handling input but lacks direct support for streaming stdin continuously.Arguments (
Args
) and stdin: The traditional way of parsing command line options doesn't directly support piping input as arguments.Proposal for Enhancement:
Arg
combinator that can handle stdin as if it were an argument.-
to indicate reading from stdin, mimicking conventions from other CLI tools.Args
, allowing a stream fromstdin
to be treated as part of the argument parsing process.Challenges and Considerations:
Implementation Ideas:
Args
that can incorporate stdin, possibly resulting in aStream<string>
.The conversation involves contributions from several community members, considering both current limitations and potential enhancements to better handle piped input in CLI applications.
Discord thread
https://discord.com/channels/795981131316985866/1234796735730286654
The text was updated successfully, but these errors were encountered: