Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Be able to pipe data to bun --print #9438

Open
mathiasrw opened this issue Mar 15, 2024 · 1 comment
Open

Be able to pipe data to bun --print #9438

mathiasrw opened this issue Mar 15, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@mathiasrw
Copy link
Contributor

mathiasrw commented Mar 15, 2024

What is the problem this feature would solve?

Keeping longer scripts (and multi line scripts) outside of package.js and other places that uses --print

What is the feature you are proposing to solve the problem?

Have bun --print use the data that is piped in as the js source if no parameter has been provided

cat '2+3' | bun --print
5

What alternatives have you considered?

If you generate the JS content you want to run you can store that in a file instead of piping it and call bun run x.js - while also adding console.log() around the last statement.

@mathiasrw mathiasrw added the enhancement New feature or request label Mar 15, 2024
@Jarred-Sumner
Copy link
Collaborator

cool idea

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants