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

sio-terminaltopbar

v1.0.0

Published

Topbar and hero ascii icon for your terminal.

Downloads

3

Readme

SIO-TerminalTopBar - Inquirer

Build Status

Full presentation code

Full code Full inquirer

        inquirer.topBar.title=`
 $$$$$$   $$$$$$   $$$$$$
$$    $$    $$    $$    $$
$$          $$    $$    $$
$$$$$$      $$    $$    $$
     $$     $$    $$    $$
$$   $$     $$    $$    $$
$$$$$$    $$$$$$   $$$$$$ 
    `;
        inquirer.topBar.render();
        topBar.log("Hello world");
        topBar.error("Error 404");
        topBar.info("Very important info");
        topBar.warn("I can make warns");
        topBar.log("If i have more than 7 lines I can be scrolled");
        topBar.warn("And my borders changes dinamically to adapt to the user interactions");
        topBar.log("So i'm line 7");
        topBar.warn("And i'm line 8");

Creates a visual top bar and ASCII icon hero for your terminal project.

  • Gets well with inquirer
  • Make your terminal more atractive
  • Easy to use
  • You can travel the logs history with CTRL and the Down and Up keys.
  • The border updates on your actions to give you visible information.

Background

Using inquirer proves to be a good option for full terminal aplications but inquirer doesn't play very well with another console write options.

Sometimes you require to log very well visible and gratefull to see logs to your users.

Installation

SIO-TerminalTopBar was tested on Node.js v14+.

Install the package in your current project to start using it.

$ npm install sio-terminaltopbar

Without inquirer:

const topBar=require("sio-terminaltopbar");
topBar.render();

With inquirer (This lets you onli require inquirer into another modules and SIO-TerminalTopBar will be included as well):

//Modulo inicial
const topBar=require("sio-terminaltopbar");
const inquirer=require("inquirer");
inquirer.topBar.render();
inquirer.topBar.log("Inside start module");

//Any other module
const inquirer=require("inquirer");
inquirer.topBar.log("Inside any other module, inquirer has already","SIO-TerminalTopBar included");

Methods and attributes

All examples will be made without inquirer. If you are using it with the inquirer method just add "inquirer." before all the topBar calls.

Attributes

Title:

Use this attribute to print something on top of the SIO-TerminalTopBar

topBar.title=`
     $$$$$$   $$$$$$   $$$$$$
    $$    $$    $$    $$    $$
    $$          $$    $$    $$
    $$$$$$      $$    $$    $$
         $$     $$    $$    $$ 
    $$   $$     $$    $$    $$ 
    $$$$$$    $$$$$$   $$$$$$  
`;
topBar.render();

Result: SIO-TerminalTopBar.title

Methods

Render -> render():

Makes the top bar to update it's render, it is used mostly by the module but its required when you start the app that contains it.

topBar.render();
Log -> log(...args):

Prints a log inside the SIO-TerminalTopBar.

topBar.log("Hello world");
topBar.log("Can have","multiple arguments");
tobBar.log({inclusive:"objects"},["and","arrays"]);

SIO-TerminalTopBar.log

Error -> error(...args):

Prints an error inside the SIO-TerminalTopBar.

topBar.error("Hello world");
topBar.error("Can have","multiple arguments");
tobBar.error({inclusive:"objects"},["and","arrays"]);

SIO-TerminalTopBar.log

Warn -> warn(...args):

Prints a warn inside the SIO-TerminalTopBar.

topBar.warn("Hello world");
topBar.warn("Can have","multiple arguments");
tobBar.warn({inclusive:"objects"},["and","arrays"]);

SIO-TerminalTopBar.log

Info -> info(...args):

Prints an info inside the SIO-TerminalTopBar.

topBar.info("Hello world");
topBar.info("Can have","multiple arguments");
tobBar.info({inclusive:"objects"},["and","arrays"]);

SIO-TerminalTopBar.log

Clear -> clear():

Adds empty spaces to the SIO-TerminalTopBar to make the next log see visible by his own. Its important to notice that this doesn't erase the lines of the topBar, this means you can press CTRL + Up to go back on the log history.

topBar.log("Hello world");
topBar.clear();
tobBar.info("Only i'm visible. See how the top margin of the SIO-TerminalTopBar changes.","That means that you can press CTRL + UP[arrow key up] to view old logs");

SIO-TerminalTopBar.log

Clean -> clean():

Deletes all history logs and renders an empty SIO-TerminalTopBar.

topBar.log("Hello world");
topBar.error("I'm gonna be erased in a second","If that's not an error what could be one.");
topBar.clean();

SIO-TerminalTopBar.log

Todos

  • If text is bigger than the screen it shows ellipsis, so add right and left key funcionality.
  • Let the user define the height and width size of the topBar.
  • Without inquirer get the last cursor pos to return to it once topBar is rendered, it may fail with some user uses cases.

License

ISC