Created
June 6, 2017 09:57
-
-
Save keevitaja/d9eac64930c85caf8a190f27d5f5732c 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 | |
let page = [] | |
const display = blessed.box({ | |
parent: screen, | |
left: 0, | |
top: 0, | |
width: "100%", | |
height: "100%" | |
}) | |
const add = ()=> { | |
for (let j = 0; j < 10; j++) { | |
let rand = Math.random().toString() | |
page.push(index + ': ' + rand.red + rand.green + rand.yellow + rand.blue) | |
index++ | |
} | |
display.setContent(page.slice(-60).join('\n')) | |
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