@kljj04/cli-kit 1.0.0 → 1.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kljj04/cli-kit",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "All-in-one terminal styling library. Colors, boxes, tables, spinners, and progress bars.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,6 +12,10 @@
12
12
  ],
13
13
  "author": "kljj04",
14
14
  "license": "MIT",
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/a93137258-ai/cli-kit.git"
18
+ },
15
19
  "files": [
16
20
  "index.js",
17
21
  "src/",
package/src/box.js CHANGED
@@ -0,0 +1,16 @@
1
+ const { RESET } = require('./color');
2
+
3
+ function box(prefix, text) {
4
+ const lines = String(text).split('\n');
5
+ const maxLen = Math.max(...lines.map(l => l.length));
6
+ const horizontal = '─'.repeat(maxLen + 2);
7
+
8
+ console.log(`${prefix}┌${horizontal}┐${RESET}`);
9
+ lines.forEach(line => {
10
+ const pad = ' '.repeat(maxLen - line.length);
11
+ console.log(`${prefix}│ ${line}${pad} │${RESET}`);
12
+ });
13
+ console.log(`${prefix}└${horizontal}┘${RESET}`);
14
+ }
15
+
16
+ module.exports = { box };
File without changes