
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Plot values from stdin
directly into your terminal.
npm install -g cli-plot
Say you have the following shell script that outputs numbers on stdout
:
for i in {1..50}; do
echo $RANDOM;
sleep 1;
done
Or the following Node
program that outputs a sine wave:
var i = 0;
setInterval(function() {
var value = Math.sin(i += 0.2);
process.stdout.write(value + '\n');
}, 100);
You can pipe it into plot
to generate a chart right there in your terminal.
It will push new values from the right every time they arrive on stdin.
Note: input values must be separated by a new line.
node sine.js | plot
plot -w 100
: graph width (in terminal rows)plot -h 10
: graph height (in terminal rows)If the input program outputs numbers very often, the chart will probably move too fast. You can pipe the output into a tool like cli-average.
./random.sh | avg -t 1s | plot
One common usage is to run a command at a given rate, and plot its results.
Unfortunately, the watch
command also outputs debug info and ANSI escape codes,
which doesn't play well with plot
. You'll need to use different way to watch that command,
for example cli-interval.
interval -t 1s "echo $RANDOM" | plot
The easiest way is to use tools like json or jQ.
some_program | json "path.to.value" | plot
FAQs
Plot values from stdin directly in your terminal
We found that cli-plot demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.