Gathering detailed insights and metrics for @visulima/boxen
Gathering detailed insights and metrics for @visulima/boxen
Gathering detailed insights and metrics for @visulima/boxen
Gathering detailed insights and metrics for @visulima/boxen
Visulima is the next-gen JavaScript framework for JAMStack blogs, sites & apps.
npm install @visulima/boxen
Typescript
Module System
Min. Node Version
Node Version
NPM Version
@visulima/cerebro@1.1.46
Updated on Jun 04, 2025
@visulima/boxen@2.0.2
Updated on Jun 04, 2025
@visulima/pail@2.1.25
Updated on Jun 04, 2025
@visulima/api-platform@3.0.44
Updated on Jun 04, 2025
@visulima/jsdoc-open-api@2.0.81
Updated on Jun 04, 2025
@visulima/find-cache-dir@1.0.31
Updated on Jun 04, 2025
TypeScript (93.51%)
JavaScript (5.17%)
MDX (1.02%)
Handlebars (0.14%)
Shell (0.08%)
CSS (0.08%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
16 Stars
2,703 Commits
3 Forks
2 Watchers
17 Branches
2 Contributors
Updated on Jun 10, 2025
Latest Version
2.0.2
Package Id
@visulima/boxen@2.0.2
Unpacked Size
108.45 kB
Size
30.70 kB
File Count
18
NPM Version
10.9.2
Node Version
18.20.8
Published on
Jun 04, 2025
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
No dependencies detected.
Create boxes in the terminal, built on top of
[][typescript-url] [![npm-image]][npm-url] [![license-image]][license-url]
Daniel Bannert's open source work is supported by the community on GitHub Sponsors
1npm install @visulima/boxen
1yarn add @visulima/boxen
1pnpm add @visulima/boxen
1import { boxen } from "@visulima/boxen"; 2 3console.log(boxen("unicorn", { padding: 1 })); 4/* 5┌─────────────┐ 6│ │ 7│ unicorn │ 8│ │ 9└─────────────┘ 10*/ 11 12console.log(boxen("unicorn", { padding: 1, margin: 1, borderStyle: "double" })); 13/* 14 ╔═════════════╗ 15 ║ ║ 16 ║ unicorn ║ 17 ║ ║ 18 ╚═════════════╝ 19 20*/ 21 22console.log( 23 boxen("unicorns love rainbows", { 24 headerText: "magical", 25 headerAlignment: "center", 26 }), 27); 28/* 29┌────── magical ───────┐ 30│unicorns love rainbows│ 31└──────────────────────┘ 32*/ 33 34console.log( 35 boxen("unicorns love rainbows", { 36 headerText: "magical", 37 headerAlignment: "center", 38 footerText: "magical", 39 footerAlignment: "center", 40 }), 41); 42/* 43┌────── magical ───────┐ 44│unicorns love rainbows│ 45└────── magical ───────┘ 46*/
Check more examples in the examples folder.
Type: string
Text inside the box.
Type: object
Type: (border: string, position: BorderPosition, length: number) => string
\
Set the color of the box border.
1import { boxen } from "@visulima/boxen"; 2import { red, green, yellow, blue } from "@visulima/colorize"; 3 4console.log( 5 boxen("Hello, world!", { 6 borderColor: (border, position) => { 7 if (["top", "topLeft", "topRight"].includes(position)) { 8 return red(border); 9 } 10 11 if (position === "left") { 12 return yellow(border); 13 } 14 15 if (position === "right") { 16 return green(border); 17 } 18 19 if (["bottom", "bottomLeft", "bottomRight"].includes(position)) { 20 return blue(border); 21 } 22 }, 23 }), 24);
Type: string | object
Default: 'single'
Values:
'single'
┌───┐
│foo│
└───┘
'double'
╔═══╗
║foo║
╚═══╝
'round'
('single'
sides with round corners)╭───╮
│foo│
╰───╯
'bold'
┏━━━┓
┃foo┃
┗━━━┛
'singleDouble'
('single'
on top and bottom, 'double'
on right and left)╓───╖
║foo║
╙───╜
'doubleSingle'
('double'
on top and bottom, 'single'
on right and left)╒═══╕
│foo│
╘═══╛
'classic'
+---+
|foo|
+---+
'arrow'
↘↓↓↓↙
→foo←
↗↑↑↑↖
'none'
foo
Style of the box border.
Can be any of the above predefined styles or an object with the following keys:
1{ 2 topLeft: '+', 3 topRight: '+', 4 bottomLeft: '+', 5 bottomRight: '+', 6 top: '-', 7 bottom: '-', 8 left: '|', 9 right: '|' 10}
Type: string
Display text at the top of the box. If needed, the box will horizontally expand to fit the text.
Example:
1import { boxen } from "@visulima/boxen"; 2 3console.log(boxen("foo bar", { headerText: "example" })); 4 5/* 6┌ example ┐ 7│foo bar │ 8└─────────┘ 9*/
Type: (text: string) => string
1import { red } from "@visulima/colorize"; 2import { boxen } from "@visulima/boxen"; 3 4console.log( 5 boxen("foo bar", { 6 headerText: "example", 7 headerColor: (text) => red(text), 8 }), 9);
Type: string
Default: 'left'
Align the text in the top bar.
Values:
'left'
1┌ example ──────┐ 2│foo bar foo bar│ 3└───────────────┘
'center'
1┌─── example ───┐ 2│foo bar foo bar│ 3└───────────────┘
'right'
1┌────── example ┐ 2│foo bar foo bar│ 3└───────────────┘
Type: string
Display text at the bottom of the box. If needed, the box will horizontally expand to fit the text.
Example:
1import { boxen } from "@visulima/boxen"; 2 3console.log(boxen("foo bar", { footerText: "example" })); 4 5/* 6┌─────────┐ 7│foo bar │ 8└ example ┘ 9*/
Type: (text: string) => string
1import { red } from "@visulima/colorize"; 2import { boxen } from "@visulima/boxen"; 3 4console.log( 5 boxen("foo bar", { 6 footerText: "example", 7 footerColor: (text) => red(text), 8 }), 9);
Type: string
Default: 'left'
Align the footer text.
Values:
'left'
1┌───────────────┐ 2│foo bar foo bar│ 3└ Footer Text ──┘
'center'
1┌───────────────┐ 2│foo bar foo bar│ 3└─── example ───┘
'right'
1┌───────────────┐ 2│foo bar foo bar│ 3└────── example ┘
Type: number
Set a fixed width for the box.
Note: This disables terminal overflow handling and may cause the box to look broken if the user's terminal is not wide enough.
1import { boxen } from "@visulima/boxen"; 2 3console.log(boxen("foo bar", { width: 15 })); 4// ┌─────────────┐ 5// │foo bar │ 6// └─────────────┘
Type: number
Set a fixed height for the box.
Note: This option will crop overflowing content.
1import { boxen } from "@visulima/boxen"; 2 3console.log(boxen("foo bar", { height: 5 })); 4// ┌───────┐ 5// │foo bar│ 6// │ │ 7// │ │ 8// └───────┘
Type: boolean | (width: number, height: number) => [width: number, height: number]
Whether or not to fit all available space within the terminal.
Pass a callback function to control box dimensions:
1import { boxen } from "@visulima/boxen"; 2 3console.log( 4 boxen("foo bar", { 5 fullscreen: (width, height) => [width, height - 1], 6 }), 7);
Type: number | object
Default: 0
Space between the text and box border.
Accepts a number or an object with any of the top
, right
, bottom
, left
properties. When a number is specified, the left/right padding is 3 times the top/bottom to make it look nice.
Type: number | object
Default: 0
Space around the box.
Accepts a number or an object with any of the top
, right
, bottom
, left
properties. When a number is specified, the left/right margin is 3 times the top/bottom to make it look nice.
Type: string
Default: 'left'
Values: 'right'
'center'
'left'
Float the box on the available terminal screen space.
Type: (text: string) => string
\
1import { bgRed } from "@visulima/colorize"; 2import { boxen } from "@visulima/boxen"; 3 4console.log( 5 boxen("foo bar", { 6 textColor: (text) => bgRed(text), 7 }), 8);
Type: string
Default: 'left'
Values: 'left'
'center'
'right'
Align the text in the box based on the widest line.
Type: false | number
Default: 4
Transform tab characters to spaces. Set to false
to disable.
Libraries in this ecosystem make the best effort to track Node.js’ release schedule. Here’s a post on why we think this is important.
If you would like to help take a look at the list of issues and check our Contributing guidelines.
Note: please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
The visulima boxen is open-sourced software licensed under the [MIT][license-url]
[typescript-url]: https://www.typescriptlang.org/ "TypeScript" "typescript" [license-image]: https://img.shields.io/npm/l/@visulima/boxen?color=blueviolet&style=for-the-badge [license-url]: LICENSE.md "license" [npm-image]: https://img.shields.io/npm/v/@visulima/boxen/latest.svg?style=for-the-badge&logo=npm [npm-url]: https://www.npmjs.com/package/@visulima/boxen/v/latest "npm"
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
project has 4 contributing companies or organizations
Details
Reason
no dangerous workflow patterns detected
Reason
update tool detected
Details
Reason
license file detected
Details
Reason
30 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 10
Reason
SAST tool detected: CodeQL
Details
Reason
dependency not pinned by hash detected -- score normalized to 8
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Score
Last Scanned on 2025-07-08T07:32:37Z
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More