Skip to content

Add stdin support for rodney js#31

Open
slaskis wants to merge 2 commits into
simonw:mainfrom
slaskis:js-stdin-support
Open

Add stdin support for rodney js#31
slaskis wants to merge 2 commits into
simonw:mainfrom
slaskis:js-stdin-support

Conversation

@slaskis
Copy link
Copy Markdown

@slaskis slaskis commented Feb 18, 2026

Pipe a JS expression directly via stdin instead of passing it as a shell argument — useful for complex expressions, multi-line scripts, and heredocs.

echo 'document.title' | rodney js
cat script.js | rodney js
rodney js - < expr.js

Pass - as the argument to read from stdin explicitly (consistent with rodney file). When no argument is given, stdin is read only if it is a pipe; an interactive terminal still shows the usage message.

Adds four integration tests that exercise no-arg piping, the - flag, multi-line / heredoc-style input, and whitespace trimming.

Fixes #26

slaskis and others added 2 commits February 18, 2026 20:35
Pipe a JS expression directly via stdin instead of passing it as a
shell argument — useful for complex expressions, multi-line scripts,
and heredocs.

  echo 'document.title' | rodney js
  cat script.js | rodney js
  rodney js - < expr.js

Pass `-` as the argument to read from stdin explicitly (consistent
with `rodney file`). When no argument is given, stdin is read only if
it is a pipe; an interactive terminal still shows the usage message.

Adds four integration tests that exercise no-arg piping, the `-` flag,
multi-line / heredoc-style input, and whitespace trimming.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.

could rodney js accept expression as stdin?

1 participant