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 🙏

© 2026 – Pkg Stats / Ryan Hefner

term-grid

v0.1.8

Published

Create grid in the terminal, config color,width,align for each column

Readme

term-grid

term-grid create grid in the terminal, you can config color,width,align for each column.

Install

$ npm install term-grid

Usage

  var Grid = require("term-grid");
  var grid = new Grid([["Name","Age","City"],["Allan",20,"New York"],["Jack",30,"London"]]);
  grid.setColor(0,"green");
  grid.setWidth(1,10);
  grid.setAlign(2,"right");
  grid.draw();
  

rect

API

- setWidth(column,width)

set width for column . width 0(and is default) means auto

  grid.setWidth(0,10); //set the first column with width 10
  grid.setWidth([10,20,5,10]); //set each column

- setColor([column,]color)

set color for column.

if the first param column not set, all column will be set to color .

color could be a string or a function returns string.

colors string support : black red green yellow blue magenta cyan white

  grid.setColor(0,"red"); //set the first column red
  grid.setColor(["red","yellow","green"]); //set each column
  set the second column data `red` when it's greater than 10
  grid.setColor(1,function(content,row,column){
    if(content > 10){
        return "red";
    }
  });
  //equals setColor("red")
  grid.setColor(function(content,row,column){
     return "red";
  });

Notice that colors are managed group by column , and each column could has only one color ever a string or a function.

setColor to the same column will overwrite the color set before.

setColor without param column will overwrite all column color.

- setAlign(column,width)

set width for column , left right,center and left by default.

  grid.setAlign(0,"center"); //set the first column align center
  grid.setAlign(['left','center' ,'left','right']); //set each column

- draw()

draw grid to the terminal

output grid to file

Default output stream is process.stdout. You can set 'grid.stream' to other Stream;

grid.stream = require("fs").createWriteStream("grid.txt");
grid.draw();

license

MIT