question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

stdin without pipe

See original GitHub issue

I want to feed prettier input from stdin without piping. Other formatters have a - or --stdin flag which does the same, or have this behaviour when no arguments are passed.

Environments:

  • Prettier Version: 2.7.1
  • Running Prettier via: cli
  • Runtime: node v16.15.1 from volta
  • Operating System: Linux
  • Prettier plugins (if any): not relevant

Steps to reproduce:

prettier --stdin-filepath=foo.json -
{"foo":1,"bar":2}
^D

Expected behavior: Writes

{ "foo": 1, "bar": 2 }

to stdout

Actual behavior: Error message

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
kkyusufkcommented, Aug 18, 2022

@artemkovalyov Yes I have. Should raise a PR for this soon. 😉

2reactions
fiskercommented, Aug 11, 2022

We can add support for it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

bash - Send string to stdin - Stack Overflow
Here's a solution that matches all three conditions: /my/bash/script < <(echo 'This string will be sent to stdin.
Read more >
Why doesn't piping work for a command that expects stdin?
Is that not equivalent to just piping? Apparently no. No it isn't. Here I try to put the contents of ls into a...
Read more >
How does piping affect stdin? - Unix & Linux Stack Exchange
A pipe is a buffer allocated in the kernel with file descriptors associated with the read and write ends. When you run cat...
Read more >
linux - Can I send some text to the STDIN of an active process ...
It is possible to send input text to a running process without running the screen ... First create a named pipe to route...
Read more >
Bash One-Liners Explained, Part III: All about redirections
This works on bash versions starting 4.0. The |& redirection operator sends both stdout and stderr of command1 over a pipe to stdin...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found