diff --git a/README.md b/README.md index 2638b5c..86cf7f7 100644 --- a/README.md +++ b/README.md @@ -21,6 +21,15 @@ var Tput = require('blessed').Tput console.log(tput.setaf(4) + 'hello' + tput.sgr0()); ``` +To play around with it on the command line, it works just like tput: + +``` bash +$ tput.js setaf 2 +$ tput.js sgr0 +``` + +The higher level functionality is exposed in the main `blessed` module: + ``` js var blessed = require('blessed') , program = blessed(); diff --git a/bin/tput.js b/bin/tput.js new file mode 100755 index 0000000..f5d7126 --- /dev/null +++ b/bin/tput.js @@ -0,0 +1,9 @@ +#!/usr/bin/env node + +var tput = require('../lib/tput')(process.env.TERM || 'xterm') + , argv = process.argv.slice(2) + , cmd = argv.shift(); + +if (tput[cmd]) { + process.stdout.write(tput[cmd].apply(tput, argv)); +} diff --git a/package.json b/package.json index 5f073d2..1f09f29 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,12 @@ "author": "Christopher Jeffrey", "version": "0.0.3", "main": "./lib/program.js", + "bin": "./bin/tput.js", + "preferGlobal": false, "repository": "git://github.com/chjj/blessed.git", "homepage": "https://github.com/chjj/blessed", "bugs": { "url": "http://github.com/chjj/blessed/issues" }, - "keywords": ["curses", "tui"], - "tags": ["curses", "tui"], + "keywords": ["curses", "tui", "tput"], + "tags": ["curses", "tui", "tput"], "scripts": { "test": "node test", "bench": "node test --bench" } }