npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-ncurses

v1.0.0

Published

library for ncurses-style GUI rendering in node.js

Downloads

5

Readme

node-ansi

ncurses library for node.js


Frame() Object

DESCRIPTION:

this library is meant to be used in conjunction with other libraries that
store display data in a Frame() object or objects
this allows for "windows" that can be hidden, moved, closed, etc...
without destroying the data behind them.

the object itself takes the following parameters:

	x: 			the coordinate representing the top left corner of the frame (horiz)
	y: 			the coordinate representing the top left corner of the frame (vert)
	width: 		the horizontal width of the frame 
	height: 	the vertical height of the frame
	attr:		the default color attributes of the frame
	parent:		a frame object representing the parent of the new frame
	

METHODS:

frame.open()				//populate frame contents in character canvas
frame.close()				//remove frame contents from character canvas
frame.delete()				//delete this frame (remove from screen buffer, destroy internal references)
frame.invalidate()			//clear screen buffer to redraw contents on cycle() or draw()
frame.draw()				//open frame (if not open) move to top (if not on top) and cycle()
frame.refresh()				//flag all frame sectors for potential update
frame.load(filename)		//load a binary graphic (.BIN) or ANSI graphic (.ANS) file
frame.bottom()				//push frame to bottom of display stack
frame.top()					//pull frame to top of display stack
frame.scroll(x,y)			//scroll frame n spaces in any direction
frame.scrollTo(x,y)			//scroll frame to absolute offset
frame.move(x,y)				//move frame n spaces in any direction
frame.moveTo(x,y)			//move frame to absolute position
frame.end()					//opposite of frame.home()
frame.screenShot(file,append)
							//capture the contents of a frame to file
frame.getData(x,y,use_offset)
							//return the character and attribute located at x,y in frame.data (optional scroll offset)
frame.setData(x,y,ch,attr,use_offset)
							//modify the character and attribute located at x,y in frame.data (optional scroll offset)
frame.clearData(x,y,use_offset)
							//delete the character and attribute located at x,y in frame.data (optional scroll offset)
frame.clearline(attr)		//see http://synchro.net/docs/jsobjs.html#console
frame.cleartoeol(attr)
frame.putmsg(str,attr)
frame.clear(attr)
frame.home()
frame.center(str,attr)
frame.crlf()
frame.getxy()
frame.gotoxy(x,y)
frame.pushxy()
frame.popxy()

PROPERTIES:

frame.x						//x screen position
frame.y						//y screen position
frame.width					//frame width
frame.height				//frame height
frame.data					//frame data matrix 
frame.data_height			//true height of frame contents (READ ONLY)
frame.data_width			//true width of frame contents (READ ONLY)
frame.attr					//default attributes for frame
frame.checkbounds			//toggle true/false to restrict/allow frame movement outside display
frame.lf_strict				//toggle true/false to force newline after a crlf-terminated string
frame.v_scroll				//toggle true/false to enable/disable vertical scrolling
frame.h_scroll				//toggle true/false to enable/disable horizontal scrolling
frame.scrollbars			//toggle true/false to show/hide scrollbars
frame.transparent			//toggle true/false to enable transparency mode 
							//(do not display frame sectors where char == undefined)
frame.offset				//current offset object {x,y}
frame.cursor				//current cursor object {x,y}
frame.parent				//the parent frame of a frame
frame.id					//a unique identifier (e.g. "0.1.1.2.3")
frame.is_open				//return true is frame is opened in screen buffer

USAGE:

var Frame = require('node-curses');

//create a new frame object at screen position 1,1. 80 characters wide by 24 tall
var frame = new Frame(1,1,80,24,BG_BLUE);

//add frame to the display canvas
frame.open();

//add a new frame within the frame object that will display on top at position 10,10
var subframe = new Frame(10,10,10,10,BG_GREEN,frame);

//add subframe to the display canvas
subframe.open();

//place cursor at position x:5 y:5 relative to subframe's coordinates
subframe.gotoxy(5,5);

//print a message into subframe
subframe.putmsg("1");
	
//close out the entire frame tree
frame.close();