🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

console-gridlist

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

console-gridlist

Grid generator for console and markdown code-blocs

1.2.0
unpublished
latest
Source
npm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Grid for code-blocs and console

Install

npm install console-gridlist@latest

Syntaxe

let title = "title"
// The title of grid
// String only
// Line breaks accepted

let head = ["","","",...]
/* The titles of each column
	You can set the alignment of cells 
	by including one of these arrows in 
	a column title. 
		left : ←
		right : →
		center : none
*/

// The body is a 2D array 
// that contains the elements
let body = [
	["","","",...],
	["","","",...],
	["","","",...],
	...
]

// Syntaxe
console.log( grid( title, head, body))

Good to know

All arrays in the body must be the same length as the head array. A title setting will be added in future releases. The size of the grid depends on the size of the elements that are displayed.

Example

const grid = require("console-gridlist")

let example = grid("Classement",

	// head from string
	"id→,name,←age",

	[// body

		// from Array
		["1","patrick","20"],

		// from String
		"2,bob,30",

		// from Object values
		{id:3,name:"louis",age:21}

		// from other... 
		// (Map, Discord.Collection)
	]
)

console.log(example)

Result

╔════════════════════╗
║     Classement     ║
╠════╦═════════╦═════╣
║ id ║  name   ║ age ║
╠════╬═════════╬═════╣
║  1 ║ patrick ║ 20  ║
║  2 ║   bob   ║ 30  ║
║  3 ║  louis  ║ 21  ║
╚════╩═════════╩═════╝

Keywords

console

FAQs

Package last updated on 03 May 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts