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 🙏

© 2025 – Pkg Stats / Ryan Hefner

tercon

v0.1.1

Published

Terminal Control

Downloads

17

Readme

This program is used as a library for full-screen terminal controls. The
export is the Screen function which can be called as a constructor. (Note:
Currently it does not do much and there may be some bugs; it may be fixed
later on. Also it is not currently compatible with Windows for local
terminals; you may be able to use it with remote terminals but this
function is currently untested.)

The constructor takes two arguments: Screen(output,input) if you omit both
then it applies to the stdin/stdout connected terminal, and it will also
call stty and will automatically restore the terminal when the program is
terminated (it will handle the process exit event). If you omit the input
but do specify output, then it is both same one (for example, if it is a
socket, so that you can make a telnet service).

All strings must be using the UTCE character set; it will automatically
convert into the relevant ISO 2022 encoding. (Currently, only ASCII and
VT100 character graphics are supported.)

Static properties:

.colorMap = An array of colour codes; converts PC colour codes into ANSI
colour codes.

.strwidth(x) = Tell you the width of string x.

Instance/prototype properties:

.bell() = Ring the terminal bell.

.cls([full]) = Clear the screen. If there is a window, only wildow will be
clear unless you specify true as its argument in which case you can clear
everything.

.color(x) = Set the colour. The format is the same as PC colours (with
blinking instead of high intensity background), and bit8 means underline.
Also programs the background colour to clear the screen.

.delayRefresh() = Delays a refresh of the current terminal parameters.

.height = Height of the screen. (Do not change this value unless the
height of the screen is actually changed using another mechanism.)

.locate([y],[x],[cursor]) = Set the cursor position (1-based). You can
also set whether or not the cursor is visible (true to make visible,
false to make not visibiel; null or undefined means no change).

.nextLine() = Emit a line break. It will scroll the screen if necessary.

.onInput(key) = Called when the user pushes a key (except escape). You
can override this to respond to keys. The parameter given will be the
ANSI code of the key pushed.

.onResize(w,h) = Called when the terminal is resized. You can override
this to specify what to do in such case.

.print(x) = Print text. Can include line breaks.

.printRaw(x) = Print a raw UTCE string without updating the internal
knowledge of the cursor position; can't include control characters. You
can override this if you want to control the translation from UTCE into
the terminal's codes.

.refresh([x]) = Refresh current terminal parameters immediately. You can
optionally specify a ANSI string for additional parameters.

.scroll(amount) = Scroll the screen (or the current window). Positive
numbers move existing text up and leave blank space at the bottom;
negative numbers move existing text down and leave space at the top.

.view(top,left,height,width) = Set the window (coordinates are 1-based).
If you omit all parameters then it applies to full screen.

.width = Width of the screen. (Do not change this value unless the width
of the screen is actually changed using another mechanism.)