
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
meter = require 'cli-meter'
Creating a meter
# 100 steps by default
m = new Meter()
# optional total steps
m = new Meter(total: 500)
# optional starting value
m = new Meter(total: 500, value: 120)
# optional display length in the terminal
m = new Meter(total: 500, length: 30)
You can then manipulate it with
m.step(1) # increment by 1
m.step(-3) # decrement by 3
m.set(70) # jump to 70
And finally display it
console.log "Processing #{m}"
# Processing [============== ]
console.log "#{m} #{m.value} dB"
# [============== ] 30 dB
console.log "#{m} #{m.value} / #{m.total}"
# [============== ] 230 / 500
If you use console.log
, the meter will be printed to a different line each time:
# [============ ] 6 / 10
# [================ ] 8 / 10
If you have a TTY
stream like process.stdout
, you can show animations instead:
setInterval (->
process.stdout.write "Meter 1 #{m1}\n"
process.stdout.write "Meter 2 #{m2}\n"
process.stdout.write "Meter 3 #{m3}\n"
process.stdout.moveCursor 0, -3
), 100
FAQs
Dynamic meter in your terminal
The npm package cli-meter receives a total of 0 weekly downloads. As such, cli-meter popularity was classified as not popular.
We found that cli-meter 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.