Bindings for the native curses library, a full featured console IO library.
Bindings for the native curses library, a full featured console IO library. Compiles on Windows with Visual Studio 10 or Linux/UNIX with GCC toolchain. The curses library for the target system will automatically be downloaded and compiled into a static library on installation.
On Windows the PDCurses library will be used and on Linux/UNIX it links against the ncurses library.
To install curses just type:
npm install curses
or install from GIT
git clone git://github.com/fresc81/node-curses cursescd cursesnpm install .
If you have changed the C++ sources:
/* load curses */var curses =/* initialize top level window */stdwin = curses/* color pair definitions */GLYPH_COLOR = 1BORDER_COLOR = 2;/* initialize color pairs (id, FG, BG) */if cursescurses;/* glyph color */curses;/* border color */curses;/* clear toplevel window and draw border */curses;curses;curses;curses;/* create a subwindow */var sub_height = 20sub_width = 30sub_top = 1sub_left = 1subwin = curses;/* setup the subwindow's background and echo Hello world! into it */curses;curses;curses;curses;curses;curses;curses;/* wait for a keystroke */curses;/* reset terminal (never forget this) */curses;
Look at the bottom of curses.cc to see what already has been implemented.
See the ncurses manual for descriptions of the functions.