gitmyhub

blessed-contrib

JavaScript ★ 16k updated 1mo ago

Build terminal dashboards using ascii/ansi art and javascript

blessed-contrib is a Node.js library for building live dashboards that run entirely in a terminal, line charts, world maps, log views, gauges, and more, all drawn with text characters over SSH or locally.

JavaScriptNode.jsnpmsetup: easycomplexity 2/5

blessed-contrib is a JavaScript library for building dashboards that run inside a terminal window, using nothing more than text characters and the colour codes terminals understand. The description is "build dashboards (or any other application) using ascii/ansi art and javascript". It is meant to be friendly to terminals, ssh sessions, and developers — another way of saying you can run a polished-looking dashboard on a remote server over a plain SSH connection, no browser required.

It is built on top of blessed, an existing terminal-UI library for Node.js, and it adds higher-level dashboard widgets on top of blessed's basic text and list elements. The widget list in the README includes line charts, bar charts, stacked bar charts, a world map with markers, gauges and stacked gauges, donut charts, an LCD-style number display, rolling logs, pictures, sparklines, tables, trees, and markdown blocks.

The usage pattern is consistent across widgets. You require blessed and blessed-contrib, create a screen, build a widget (for example, contrib.line(...) with some style options), append it to the screen, call setData on it, and then call screen.render(). The README also shows binding keys like q or Ctrl-C to exit cleanly. Layouts are optional but useful when arranging multiple widgets into a dashboard grid.

You would use it for a live, refreshing status display — server utilisation, log tail, build progress — that runs in a terminal rather than a browser, when you are already working in Node.js. Installation is npm install blessed blessed-contrib on the latest Node.js LTS, and it works on Linux, OS X, and Windows. The full README is longer than what was provided.

Where it fits