1 # <img src="screenshot.png" width="400" alt="boxen">
3 > Create boxes in the terminal
5 [![Build Status](https://travis-ci.org/sindresorhus/boxen.svg?branch=master)](https://travis-ci.org/sindresorhus/boxen)
18 const boxen = require('boxen');
20 console.log(boxen('unicorn', {padding: 1}));
29 console.log(boxen('unicorn', {padding: 1, margin: 1, borderStyle: 'double'}));
44 ### boxen(input, [options])
57 Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white` `gray`
59 Color of the box border.
63 Type: `string` `object`<br>
78 - `round` (`single` sides with round corners)
84 - `single-double` (`single` on top and bottom, `double` on right and left)
90 - `double-single` (`double` on top and bottom, `single` on right and left)
103 Style of the box border.
105 Can be any of the above predefined styles or an object with the following keys:
123 Reduce opacity of the border.
127 Type: `number` `Object`<br>
130 Space between the text and box border.
132 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.
136 Type: `number` `Object`<br>
139 Space around the box.
141 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.
146 Values: `right` `center` `left`<br>
149 Float the box on the available terminal screen space.
151 ##### backgroundColor
154 Values: `black` `red` `green` `yellow` `blue` `magenta` `cyan` `white`
156 Color of the background.
162 Values: `left` `center` `right`
164 Align the text in the box based on the widest line.
169 - [boxen-cli](https://github.com/sindresorhus/boxen-cli) - CLI for this module
170 - [cli-boxes](https://github.com/sindresorhus/cli-boxes) - Boxes for use in the terminal
175 MIT © [Sindre Sorhus](https://sindresorhus.com)