Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

curses

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

curses - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

example/hello.js

2

package.json
{
"name" : "curses",
"version" : "0.0.2",
"version" : "0.0.3",
"description" : "Bindings for the native curses library, a full featured console IO library.",

@@ -5,0 +5,0 @@ "main" : "./curses",

@@ -43,12 +43,51 @@

/* load curses */
var curses = require('./curses')
/* load curses */
var curses = require('curses')
/* initialize top level window */
, stdwin = curses.initscr()
/* initialize top level window */
, stdwin = curses.initscr()
/* color pair definitions */
, GLYPH_COLOR = 1
, BORDER_COLOR = 2
;
// ...
/* initialize color pairs (id, FG, BG) */
if (curses.has_colors()) {
curses.start_color();
/* glyph color */
curses.init_pair(GLYPH_COLOR, curses.COLOR_GREEN, curses.COLOR_BLACK);
/* border color */
curses.init_pair(BORDER_COLOR, curses.COLOR_WHITE, curses.COLOR_BLACK);
}
// reset terminal
/* clear toplevel window and draw border */
curses.wattrset(stdwin, curses.color_pair(BORDER_COLOR));
curses.wclear(stdwin);
curses.box(stdwin, 0, 0);
curses.wrefresh(stdwin);
/* create a subwindow */
var sub_height = 20
, sub_width = 30
, sub_top = 1
, sub_left = 1
, subwin = curses.subwin(stdwin, sub_height, sub_width, sub_top, sub_left)
;
/* setup the subwindow's background and echo Hello world! into it */
curses.wattrset(subwin, curses.color_pair(GLYPH_COLOR));
curses.wbkgd(subwin, '_'.charCodeAt(0));
curses.wclear(subwin);
curses.waddstr(subwin, "Hello world!");
curses.wrefresh(subwin);
/* wait for a keystroke */
curses.wgetch(subwin);
/* reset terminal (never forget this) */
curses.endwin();

@@ -55,0 +94,0 @@

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc