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

cli-progress-box

v0.0.2

Published

Quick visual change detection indicator

Downloads

11

Readme

npm npm

cli-progress-box

Quick visual change detection indicator

Easy to use

Usage

var opts = { padding: 2, maxStep: 8, width: 3 }
var box = require( 'cli-progress-box' )( opts )

opts.character = '愛'

setInterval( function () {
  opts.clcColor = box.bgColors.bright[ opts.step ]
  console.log( box.clc.reset + box.tick() )
}, 200 )
output

About

A visual CLI change/progress indicator

Why

When you save a file and your watcher rebuilds your project it is sometimes hard to see that anything has changed because the output from the watch process is so similar to the previous output.

For who?

CLI applications.

How

cli-color

API

var progressBox = require( 'cli-progress-box' )

var opts = {} // state object ( mutates )
var box = progressBox( opts ) // create new progress box

box.tick() // alias for box()
box.redraw() // shorthand for `box.clc.reset + box.tick()`

box.clc // embedded `medikoo/cli-color` object

box.bgColors.dark // list of `medikoo/cli-color` bacground colors
box.bgColors.bright // list of bright `medikoo/cli-color` background colors
box.bgColors.all // both lists

box.fgColors.dark // list of `medikoo/cli-color` bacground colors
box.fgColors.bright // list of bright `medikoo/cli-color` background colors
box.fgColors.all // both lists

Options / Initial State

opts = opts || {}

if ( !opts.step ) opts.step = 0
if ( !opts.maxStep ) opts.maxStep = 4

if ( !opts.offset ) opts.offset = 0
if ( !opts.width ) opts.width = 2
if ( !opts.stepSize ) opts.stepSize = opts.stepSize

if ( !opts.padding ) opts.padding = 0
if ( !opts.margin ) opts.margin = 4

if ( !opts.character ) opts.character = ' '
if ( !opts.colors ) opts.colors = clcBgColors.bright.slice() // color changes based on opts.step

if ( !opts.getHeader ) opts.getHeader = function ( opts ) { return '' }
if ( !opts.getFooter ) opts.getFooter = function ( opts ) { return '' }

if ( !opts.transform ) opts.transform = _transform
if ( !opts.render ) opts.render = _render
if ( !opts.generateBox ) opts.generateBox = _generateBox

Alternatives

Test

npm test