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
Example code throws 'undefined' #23
Comments
I'm not quite sure what you're doing here. node process_name | tty-table --format=json The above line is a piped command you would run in bash. This will output a table to the CLI, given JSON input from "process_name" that is piped to tty-table in a terminal emulator. console.log(JSON.stringify(array)) The above line is nodejs code. It wouldn't be used in conjunction with the previous line. In this context, it doesn't make sense...since its nodejs code rather than bash commands. |
So how does my node process send data to stdout to be piped to tty-table, and how does tty-table read data piped to it from the output of my process? |
You might like to look at the code in: https://github.com/tecfu/tty-table/blob/master/examples/data/streamer.js |
That streamer example basically just outputs a "stream" of data to STDOUT. You then pipe it to tty-table, which reads it from STDIN. Are you running an example verbatim and finding it doesn't work? |
Yep I had realised what it was supposed to do. I have a real-time stream of data I was trying use tty-table to chart, and couldn't get it to work, so I copied and pasted the code from fake-stream into my node process and got the error reported. |
If you run the examples given, do they work? |
Running code in examples/data/fake-stream.js with
node process_name | tty-table --format=json
Output via
console.log(JSON.stringify(array))
Throws
undefined
Node v8.1.4
The text was updated successfully, but these errors were encountered: