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 🙏

© 2025 – Pkg Stats / Ryan Hefner

fast-text-table

v1.0.1

Published

Quickly generate borderless text tables with alignment

Readme

fast-text-table

npm bundle size npm NPM

Rewrite of text-table in TypeScript, making it faster and smaller.

Install

npm install fast-text-table

Usage

import table from "fast-text-table";
// or
const table = require("fast-text-table");

const t = table([
  ["master", "0123456789abcdef"],
  ["staging", "fedcba9876543210"],
]);
console.log(t);

Output:

master   0123456789abcdef
staging  fedcba9876543210

left-right align

table(
  [
    ["beep", "1024"],
    ["boop", "33450"],
    ["foo", "1006"],
    ["bar", "45"],
  ],
  { align: ["l", "r"] }
);
beep   1024
boop  33450
foo    1006
bar      45

dotted align

table(
  [
    ["beep", "1024"],
    ["boop", "334.212"],
    ["foo", "1006"],
    ["bar", "45.6"],
    ["baz", "123."],
  ],
  { align: ["l", "."] }
);
beep  1024
boop   334.212
foo   1006
bar     45.6
baz    123.

centered

table(
  [
    ["beep", "1024", "xyz"],
    ["boop", "3388450", "tuv"],
    ["foo", "10106", "qrstuv"],
    ["bar", "45", "lmno"],
  ],
  { align: ["l", "c", "l"] }
);
beep    1024   xyz
boop  3388450  tuv
foo    10106   qrstuv
bar      45    lmno

API

table(rows, [opts])

  • rows any[][] - Array of rows to format.
  • opts object - Optional options object.
    • opts.hsep string - Horizontal separator. Default: " ".
    • opts.align string[] - Array of alignment types for each column. Default: ["l", "l", ..., "l"].
      • l - Left
      • r - Right
      • c - Center
      • . - Dotted
    • opts.stringLength function - Custom string length function. Default: s => s.length.

Benchmarks

clk: ~4.18 GHz
cpu: 13th Gen Intel(R) Core(TM) i5-13400F
runtime: node 24.1.0 (x64-win32)

benchmark                   avg (min … max) p75 / p99    (min … top 1%)
------------------------------------------- -------------------------------
• table - small dataset
------------------------------------------- -------------------------------
fast-text-table                4.99 µs/iter   4.87 µs  █▂
                        (4.67 µs … 5.95 µs)   5.92 µs ▅██▇▂▂▁▁▁▁▁▁▁▁▁▁▃▃▄▃▂
                  gc(  2.41 ms …   4.42 ms)  13.29 kb ( 13.25 kb… 13.37 kb)

text-table                    20.23 µs/iter  20.24 µs        ██
                      (19.48 µs … 21.52 µs)  21.01 µs █▁▁█▁█▁████▁▁▁█▁▁▁▁▁█
                  gc(  2.47 ms …   4.59 ms)   3.13 kb (  3.08 kb…  3.17 kb)

summary
  fast-text-table
   4.05x faster than text-table

• table - middle dataset
------------------------------------------- -------------------------------
fast-text-table              263.47 µs/iter 276.20 µs    ▇▆ █▂
                    (194.60 µs … 465.30 µs) 436.00 µs ▂▂███▆██▃▄▃▂▂▃▂▁▁▁▁▁▁
                  gc(  2.29 ms …   5.08 ms) 543.81 kb (210.00 kb…801.07 kb)

text-table                     7.05 ms/iter   7.16 ms    █ ▄ ▆▃       ▄
                        (6.82 ms … 7.39 ms)   7.33 ms ▄▆▇███▆██▇█▇▇▆▆▆█▂▅▅▂
                  gc(  2.27 ms …   2.99 ms)   1.89 mb (  1.89 mb…  1.89 mb)

summary
  fast-text-table
   26.76x faster than text-table

• table - large dataset
------------------------------------------- -------------------------------
fast-text-table               10.39 ms/iter  10.51 ms  ▂   ▅█ ▂▂
                      (10.01 ms … 11.01 ms)  10.93 ms ▂█▇▃▄██▇██▆▆▃▂▇▁▆▂▃▃▃
                  gc(  2.32 ms …   3.02 ms)  34.06 mb ( 34.03 mb… 34.14 mb)

text-table                      5.43 s/iter    5.45 s     █
                          (5.38 s … 5.53 s)    5.47 s █▁▁██▁█▁▁█▁█▁▁█▁▁█▁██
                  gc(  2.64 ms …   3.78 ms)  75.76 mb ( 75.76 mb… 75.76 mb)

summary
  fast-text-table
   523.01x faster than text-table

License

MIT