term-grid-ui
v0.8.0
Published
Simple 2D color character grid abstraction for terminal apps
Readme
Term-Grid UI for Nodejs
Simple 2D color character grid abstraction for terminal apps.
npm package
https://www.npmjs.com/package/term-grid-ui
npm install --save term-grid-uiUsage
import { colors, keyCodes, makeTermGrid } from 'term-grid-ui'
const tg = makeTermGrid(10, 40)
tg.clear()
tg.set(2, 5, ':', colors.black, colors.white)
tg.draw()
tg.onInput(data => {
switch (data) {
case keyCodes.enter:
tg.text(1, 1, 'Hello world!', colors.green, colors.black)
break
case 'q':
tg.reset()
process.exit()
}
tg.draw()
})API Documentation
https://lj-ditrapani.github.io/term-grid-node/index.html
Example
To see an example cd to example/paint:
npm install
npm startand read source in paint.ts for example usage.

Develop
You'll need node. I like to use nvm https://github.com/nvm-sh/nvm.
Install npm packages
npm installFormat, lint, build, test
npm run allVisual test
npm run visual-testGenerate documentation
npm run docView documentation
firefox docs/index.htmlView test coverage report
firefox coverage/lcov-report/index.htmlUpdate dependencies
npm run ncuDon't forget to update the example apps!
Publish
rm -fr lib
npm run all
npm version patch/minor/major
npm login
npm publish