add bin/tput.js
This commit is contained in:
parent
06d6734622
commit
9b8983d355
|
@ -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();
|
||||
|
|
|
@ -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));
|
||||
}
|
|
@ -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" }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue