New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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

console-gridlist

Grid generator for console and markdown code-blocs

  • 1.2.0
  • unpublished
  • latest
  • Source
  • npm
  • Socket score

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc