JSPM

bscript

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 36
  • Score
    100M100P100Q58172F
  • License MIT

Creates a tree of elements

Package Exports

  • bscript

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (bscript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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