Skip to content

Latest commit

 

History

History
101 lines (82 loc) · 5.68 KB

README.md

File metadata and controls

101 lines (82 loc) · 5.68 KB

console.table Without (index)

The built-in Node.js console.table, but without the annoying (index) column. 📊

👪 All Contributors: 5 🤝 Code of Conduct: Kept 🧪 Coverage 📝 License: MIT 📦 npm version 💪 TypeScript: Strict

Without this utility:

console.table([
	{ emoji: "🍏", fruit: "apple" },
	{ emoji: "🍌", fruit: "banana" },
	{ emoji: "🍒", fruit: "cherry" },
]);
┌─────────┬───────┬──────────┐
│ (index) │ emoji │ fruit    │
├─────────┼───────┼──────────┤
│ 0       │ '🍏'  │ 'apple'  │
│ 1       │ '🍌'  │ 'banana' │
│ 2       │ '🍒'  │ 'cherry' │
└─────────┴───────┴──────────┘

Look at that (index) column! Wouldn't it be nice to get rid of it if you don't need it?

Usage

With this utility:

npm i console-table-without-index
import { table } from "console-table-without-index";

console.log(
	table([
		{ emoji: "🍏", fruit: "apple" },
		{ emoji: "🍌", fruit: "banana" },
		{ emoji: "🍒", fruit: "cherry" },
	]),
);
┌───────┬──────────┐
│ emoji │ fruit    │
├───────┼──────────┤
│ '🍏'  │ 'apple'  │
│ '🍌'  │ 'banana' │
│ '🍒'  │ 'cherry' │
└───────┴──────────┘

Hooray! No more (index)! 🙌

Contributors

Boris
Boris

🤔
Craigory Coppola
Craigory Coppola

🤔
Josh Goldberg ✨
Josh Goldberg ✨

💻 🖋 📖 🤔 🚇 🚧 📆 🔧
Malcolm
Malcolm

🐛
fisker Cheung
fisker Cheung

💻

💙 This package was templated with create-typescript-app.