Last active
June 6, 2017 10:23
-
-
Save keevitaja/01ca946295a8e25897a192126f5b7150 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const blessed = require('blessed') | |
const colors = require('colors') | |
const screen = blessed.screen({ | |
smartCSR: true | |
}) | |
let index = 0 | |
const display = blessed.box({ | |
parent: screen, | |
scrollable: true, | |
alwaysScroll: true, | |
left: 0, | |
top: 0, | |
width: "100%", | |
height: "100%" | |
}) | |
const add = ()=> { | |
for (let j = 0; j < 20; j++) { | |
let rand = Math.random().toString() | |
display.pushLine(index + ': ' + rand.red + rand.green + rand.yellow + rand.blue) | |
index++ | |
} | |
display.setScrollPerc(100) | |
screen.render() | |
} | |
screen.key('C-q', function() { | |
process.exit(0) | |
}) | |
screen.key('C-a', function() { | |
add() | |
}) | |
add() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment