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

@kawu/console-kit

v11.0.5

Published

A `fast`, `light weight`, `minimalist` and `reliable` module to log stuff easly and more understable.

Downloads

276

Readme

Console-kit

A fast, light weight, minimalist and reliable module to log stuff easly and more understable.

Installation

Use this command to add Console-kit

  npm i @kawu/console-kit

Usage

TS

import { ConsoleKit } from "@kawu/console-kit";
const consoleKit = new ConsoleKit();

JS

const { ConsoleKit } = require("@kawu/console-kit");
const consoleKit = new ConsoleKit();

Logging

When logging what's going on in your application is crucial, I have dedicated functions for every situation.

Example

Example

Comments

consoleKit.comment(CommentOptions);
// CommentOptions

message: string;
timestamp: boolean; // Not required

Success

consoleKit.success(CheckOptions);
// CheckOptions

message: string;
timestamp: boolean; // Not required

Info

consoleKit.info(InfoOptions);
// InfoOptions

message: string;
timestamp: boolean; // Not required

Warn

consoleKit.warn(WarnOptions);
// WarnOptions

message: string;
timestamp: boolean; // Not required

Error

consoleKit.error(ErrorOptions);
// ErrorOptions

message: string;
timestamp: boolean; // Not required

Loading

This is kinda usefull to tell that your terminal is doing background stuff.

Example

Start loader

consoleKit.startLoading(StartLoaderOptions);
// StartLoaderOptions

message: string;
timestamp: boolean; // Not required

Stop loader

consoleKit.stopLoading(StopLoaderOptions);
// StopLoaderOptions

clearLine: boolean; // Remove the loading line if true

Progress Bar

Like the loading but we know when the loading will finish.

Example

Start progress bar

consoleKit.startProgress(StartProgressOptions);
// StartProgressOptions

message: string;
percentage: number;
timestamp: boolean; // Not required

Edit the actual progress bar

consoleKit.editProgress(EditProgressOptions);
// EditProgressOptions

percentage: number;
message: string;

End progress bar

consoleKit.endProgress(EndProgressOptions);
// EndProgressOptions

clearLine: boolean; // Remove the progress bar line if true

Prompt

If your user need to give you data, then the prompt is a good way to go.

Example

Usage

consoleKit.prompt(PromptOptions);
// PromptOptions

message: string;
character: string; // Not required -- If you wish to replace "?", put your own icon here

Output

string;

YesNo

It's like prompt but for boolean values.

Example

Usage

consoleKit.yesno(YesNoOptions);
// YesNoOptions

message: string;
defaultValue: boolean; // true = yes | false = no

Output

If the default value is false and the user send for example lol then the output will be false because he didn't put no/n or yes/y.

boolean;

Select

You have a list and your user have to select an item inside a list, then this will do the job.

Example

consoleKit.select(SelectOptions);
values: Array<string>;
defaultValueIndex: number; // Not required -- Index number of the values array
selectedText: string; // Not required -- Custom the "[ • ]" (Item selected)
unselectedText: string; // Not required -- Custom the "[  ]" (Item not selected)
cleanafter: boolean; // Not required -- Remove the selection of the terminal when user finished