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-console-interface

v1.1.1

Published

A console interface library

Downloads

25

Readme

Functions

getConsoleGridInterfaceInput (horizontalBorder, verticalBorder, spacer, marker, startX, startY, borderWidth, borderHeight, showCoords, showIntructions, deleteOnCompletion)

Basic Overview

Will display a grid for the user to move around a marker with WASD keys in order to select a pair of co-ordinates.

Variables
  • horizontalBorder refers to the top and bottom border characters.
  • verticalBorder refers to the left and right border characters.
  • spacer refers to the characters inside the grid. ([Space] is recommended)
  • marker refers to the marker character that will be put at the selected co-ordinates.
  • startX and startY refers to where the marker character will start on the grid.
  • borderWidth and borderHeight refers to the width and height of the grid.
  • If showCoords is true, the user will see their X and Y position at the bottom of the console window.
  • If showInstructions is true, the user will see instructions on how to use the interface at the top of the console window.
  • If deleteOnCompletion is true, the grid will be deleted once the user selects their co-ordinates.
Usage

 

Input:

const conif = require('node-console-interface');

var coords = conif.getConsoleGridInterfaceInput('-', '|', ' ', 'O', 25, 12, 50, 25, true, true, true);
console.log('PosX: ' + coords.x);
console.log('PosY: ' + coords.y);

Output:  

Grid Example GIF

getConsoleSliderInterfaceInput (leftEndChar, rightEndChar, spacer, marker, startValue, sliderWidth, showValue, showIntructions, deleteOnCompletion)

Basic Overview

Will display a slider for the user to move around a marker with A and D keys in order to select a value.

Variables
  • leftEndChar refers to the character that will be on the left of the slider.
  • rightEndChar refers to the character that will be on the right of the slider.
  • spacer refers to the characters inside the slider. ('-' is recommended)
  • marker refers to the marker character that will be put at the selected value.
  • startValue refers to where the marker character will start on the slider.
  • sliderWidth refers to the width and height of the slider.
  • If showValue is true, the user will see the value at the right of the slider.
  • If showInstructions is true, the user will see instructions on how to use the interface at the top of the console window.
  • If deleteOnCompletion is true, the slider will be deleted once the user selects their co-ordinates.
Usage

 

Input:

const conif = require('node-console-interface');

var value = conif.getConsoleSliderInterfaceInput('<', '> ', '-', 'O', 25, 50, true, true, true);
console.log('Value: ' + value + '\n');

Output:  

Slider Example GIF

getConsoleSelectionListInterfaceInput (marker, selectedMarker, startPosition, items, showIntructions, deleteOnCompletion)

Basic Overview

Will display a list in which the user and move a marker up and down in order to select a particular item.

Variables
  • marker refers to the marker put next to each item on the list.
  • selectedMarker refers to the marker put next to an item on the list when it is selected.
  • startPosition refers to the start position of the selection.
  • items refers to the array of items in the list.
  • If showInstructions is true, the user will see instructions on how to use the interface at the top of the console window.
  • If deleteOnCompletion is true, the list will be deleted once the user selects their item.
Usage

 

Input:

const conif = require('node-console-interface');

var items = new Array();
items.push("Name1");
items.push("Name2");
items.push("Name3");
items.push("Name4");
var selection = conif.getConsoleSelectionListInterfaceInput('| ', 'O ', 1, items, true, true);
console.log('Selection: ' + selection + '\n');

Output:  

Grid Example GIF