misc - add a blessed.js file.

This commit is contained in:
Christopher Jeffrey 2013-07-24 14:40:05 -05:00
parent 1b5155cfae
commit 5e2f1061d1
8 changed files with 60 additions and 21 deletions

View File

@ -1 +1 @@
module.exports = require('./lib/program');
module.exports = require('./lib/blessed');

View File

@ -1,5 +1,6 @@
/**
* Aliases
* alias.js - terminfo/cap aliases for blessed.
* https://github.com/chjj/blessed
* Taken from terminfo(5) man page.
*/

44
lib/blessed.js Normal file
View File

@ -0,0 +1,44 @@
/**
* Blessed
* A curses-like library for node.js.
* Copyright (c) 2013, Christopher Jeffrey (MIT License).
* https://github.com/chjj/blessed
*/
/**
* Modules
*/
var program = require('./program')
, tput = require('./tput')
, widget = require('./widget')
, colors = require('./colors');
/**
* Blessed
*/
function blessed() {
return program.apply(null, arguments);
}
blessed.program = blessed.Program = program;
blessed.tput = blessed.Tput = tput;
blessed.colors = colors;
blessed.widget = widget;
Object.keys(blessed.widget).forEach(function(name) {
blessed[name] = blessed.widget[name];
});
blessed.helpers = {
sprintf: blessed.tput.sprintf,
merge: blessed.tput.merge,
tryRead: blessed.tput.tryRead
};
/**
* Expose
*/
module.exports = blessed;

View File

@ -1,5 +1,7 @@
/**
* Colors
* colors.js - color-related functions for blessed.
* Copyright (c) 2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/blessed
*/
exports.match = function(r1, g1, b1) {

View File

@ -1,7 +1,7 @@
/**
* Blessed
* A curses-like library for node.js.
* program.js - basic curses-like functionality for blessed.
* Copyright (c) 2013, Christopher Jeffrey (MIT License).
* https://github.com/chjj/blessed
*/
/**
@ -3384,13 +3384,4 @@ Program.prototype.resume = function(callback) {
* Expose
*/
exports = Program;
exports.Program = exports.program = Program;
exports.Tput = exports.tput = Tput;
exports.widget = require('./widget');
Object.keys(exports.widget).forEach(function(name) {
exports[name] = exports.widget[name];
});
module.exports = exports;
module.exports = Program;

View File

@ -1,5 +1,5 @@
/**
* Tput for node.js
* tput.js - parse and compile terminfo caps to javascript.
* Copyright (c) 2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/blessed
*/
@ -2803,5 +2803,7 @@ Tput.utoa = Tput.prototype.utoa = {
exports = Tput;
exports.sprintf = sprintf;
exports.merge = merge;
exports.tryRead = tryRead;
module.exports = exports;

View File

@ -1,6 +1,7 @@
/**
* Blessed high-level interface
* widget.js - high-level interface for blessed
* Copyright (c) 2013, Christopher Jeffrey (MIT License)
* https://github.com/chjj/blessed
* Still under heavy development.
*/
@ -1107,7 +1108,7 @@ Screen.prototype.draw = function(start, end) {
: '\x1b[?25h';
}
this.program.write(pre + main + post);
this.output.write(pre + main + post);
}
};
@ -5470,8 +5471,6 @@ function hsort(obj) {
* Expose
*/
exports.colors = colors;
exports.Screen = exports.screen = Screen;
exports.Box = exports.box = Box;
exports.Text = exports.text = Text;

View File

@ -3,7 +3,7 @@
"description": "A curses-like library for node.js.",
"author": "Christopher Jeffrey",
"version": "0.0.18",
"main": "./lib/program.js",
"main": "./lib/blessed.js",
"bin": "./bin/tput.js",
"preferGlobal": false,
"repository": "git://github.com/chjj/blessed.git",