A library to generate ASCII boxes via NodeJS
# Using npmnpm install --save cli-box# Using yarnyarn add cli-box
// Dependenciesvar Box = ;// Create a simple boxvar b1 = ;console;// Set custom marksvar b2 =w: 10h: 10stringify: falsemarks:nw: "╔"n: "══"ne: "╗"e: "║"se: "╝"s: "══"sw: "╚"w: "║"b: "░░";console;// Box with text and use the stringifyvar b3 = ;console;// Box with aligned text to top-rightvar b4 =;console;// Full screen boxvar b5 = ;console;
❓ Get Help
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. 🐛
- For direct and quick help, you can use Codementor. 🚀
Creates a new ASCII box.
options: A string representing the size:
10x20) or an object:
w(Number): The box width.
h(Number): The box height.
true, the box will have full size (default:
falsethe box will not be stringified (the
CliBoxobject will be returned instead).
marks(Object): An object containing mark characters. Default:
text: A string to be displayed or an object:
text(String): The text to be displayed.
stretch(Boolean): Stretch box to fix text (default:
autoEOL(Boolean): Break lines automatically (default:
hAlign(String): Horizontal alignement (default:
"middle"). It can take one of the values:
vAlign(String): Vertical alignement (default:
"center"). It can take one of the values:
- Object|Stringify The
false) or the stringified box.
Returns the stringified box.
- String Stringified box string.
😋 How to contribute
Have an idea? Found a bug? See how to contribute.
💖 Support my projects
I open-source almost everything I can, and I try to reply to everyone needing help using these projects. Obviously, this takes time. You can integrate and use these projects in your applications for free! You can even change the source code and redistribute (even resell it).
However, if you get some profit from this or just want to encourage me to continue creating stuff, there are few ways you can do it:
Starring and sharing the projects you like 🚀
—I love books! I will remember you after years if you buy me one. 😁 📖
—You can make one-time donations via PayPal. I'll probably buy a
—Set up a recurring monthly donation and you will get interesting news about what I'm doing (things that I don't share with everyone).
Bitcoin—You can send me bitcoins at this address (or scanning the code below):
💫 Where is this library used?
If you are using this library in one of your projects, add it in this list. ✨