bscript

0.1.0 • Public • Published

bscript

Creates a tree of elements

npm version Dependency Status js-standard-style

Install

Install with npm

$ npm i -S bscript

Example

const b = require('bscript')
 
b('box', {
  top: 2,
  left: 2
}, 'Page', [
  b('text', 'Title')
])

Usage

bscript will return a tree of nodes which can be fed into a render function to produce output on the screen.

const b = require('bscript')
const render = require('bscript-render')
const blessed = require('blessed')
 
const screen = blessed.screen({
  title: 'example'
})
 
screen.on('keypress', (ch, key) => {
  if (['escape', 'q', 'C-c'].includes(key.full)) {
    process.exit(0)
  }
})
 
render(b('text', 'Hello World'), screen)

Contributing

Pull requests are always welcome, the project uses the standard code style.

For bugs and feature requests, please create an issue.

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    8
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    8

Package Sidebar

Install

npm i bscript

Weekly Downloads

8

Version

0.1.0

License

MIT

Last publish

Collaborators

  • mattstyles