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

d-ashesss-console

v0.1.0

Published

Node.js interface to linux console advanced features

Downloads

1

Readme

Console

Provides interface to linux console advanced features.

Install via npm

npm install d-ashesss-console

Demo

To watch a demonstration run bin/demo

Usage

Console

require("d-ashesss-console");

Package will include its features into global console object.

Console::reset() - Resets the terminal to initial state

console.reset;

Console::write() - Writes to stdout without trailing newline

console.write("Hello World!");

Cursor

console.write("OOOOO\nOOOOO\nOOOOO\n");

Cursor::moveUp() - Moves cursor N lines up

console.cursor.moveUp(3);
console.write("X");
XOOOO
OOOOO
OOOOO

Cursor::moveDown() - Moves cursor N lines down

console.cursor.moveDown(2);
console.write("X");
xOOOO
OOOOO
OXOOO

Cursor::moveRight() - Moves cursor N characters right

console.cursor.moveRight(2);
console.write("X");
xOOOO
OOOOO
OxOOX

Cursor::moveLeft() - Moves cursor N characters left

console.cursor.moveLeft(2);
console.write("X");
xOOOO
OOOOO
OxOXx

Cursor::move() - Moves cursor by X:Y

console.cursor.move(-3, -1);
console.write("X");
xOOOO
OXOOO
OxOxx

Cursor::moveTo() - Moves cursor to X:Y position on screen

console.cursor.moveTo(3, 0);
console.write("X");
xOOXO
OxOOO
OxOxx

Cursor::save() - Saves cursor position and attributes. Only one position can be saved at a time: each time you call save() it overrides previously saved position.

Cursor::restore() - Restores cursor position and attributes

console.write("OOOOO\nOO");
console.cursor.save();
console.write("OOO\nOOOOO\n");
console.cursor.restore();
console.write("X");
OOOOO
OOXOO
OOOOO

Screen

Screen::init() - Saves current screen and created new empty session. Behavior is similar to such applications as Vim or Less.

Screen::restore() - Restores screen saved by Screen::init()

Screen::clearUp() - Clears screen up from cursor, including line to the left of cursor

console.write("OOOOO\nOOOOO\nOOOOO\n");
console.cursor.moveTo(2, 1);
console.screen.clearUp();
.....
...OO
OOOOO

Screen::clearDown() - Clears screen down from cursor, including line to the right of cursor

console.write("OOOOO\nOOOOO\nOOOOO\n");
console.cursor.moveTo(2, 1);
console.screen.clearDown();
OOOOO
OO...
.....

Screen::clearLeft() - Clears line to the left of cursor, including cursor position

console.write("OOOOO\nOOOOO\nOOOOO\n");
console.cursor.moveTo(2, 1);
console.screen.clearLeft();
OOOOO
...OO
OOOOO

Screen::clearRight() - Clears line to the right of cursor, including cursor position

console.write("OOOOO\nOOOOO\nOOOOO\n");
console.cursor.moveTo(2, 1);
console.screen.clearRight();
OOOOO
OO...
OOOOO

Screen::clearLine() - Clears entire line and moves cursor to the beginning of the line

console.write("OOOOO\nOOOOO\nOOOOO\n");
console.cursor.moveTo(2, 1);
console.screen.clearLine();
console.write("X");
OOOOO
X....
OOOOO

Screen::clear() - Clears entire screen and moves cursor to upper left corner