feat: 초기 프로젝트 설정 및 룰.md 파일 추가

This commit is contained in:
2025-07-28 09:53:31 +09:00
commit 09a4d38512
8165 changed files with 1021855 additions and 0 deletions

72
api.hyungi.net/node_modules/cli-tableau/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,72 @@
# Changelog
## 2.0.0
- add borders: false option
- Adapt test to mocha
- Replace manual padding with .padEnd
- Allow only Node 8
- Update travis test suite
- Upgrade chalk to 3.0.0
0.3.1 / 2014-10-22
==================
* fix example for new paths
* Readme badges
* Lighter production installs
* Safe colors
* In addition to 256-xterm ansi colors, handle 24-bit colors
* set up .travis.yml
0.3.0 / 2014-02-02
==================
* Switch version of colors to avoid npm broken-ness
* Handle custom colored strings correctly
* Removing var completely as return var width caused other problems.
* Fixing global leak of width variable.
* Omit horizontal decoration lines if empty
* Add a test for the the compact mode
* Make line() return the generated string instead of appending it to ret
* Customize the vertical cell separator separately from the right one
* Allow newer versions of colors to be used
* Added test for bordercolor
* Add bordercolor in style options and enable deepcopy of options
0.2.0 / 2012-10-21
==================
* test: avoid module dep in tests
* fix type bug on integer vertical table value
* handle newlines in vertical and cross tables
* factor out common style setting function
* handle newlines in body cells
* fix render bug when no header provided
* correctly calculate width of cells with newlines
* handles newlines in header cells
* ability to create cross tables
* changing table chars to ones that windows supports
* allow empty arguments to Table constructor
* fix headless tables containing empty first row
* add vertical tables
* remove reference to require.paths
* compact style for dense tables
* fix toString without col widths by cloning array
* [api]: Added abiltity to strip out ANSI color escape codes when calculating cell padding
0.0.1 / 2011-01-03
==================
Initial release
## Jun 28, 2017
Fork of `Automattic/cli-table`
- Merges [cli-table/#83](https://github.com/Automattic/cli-table/pull/83) (test in [6d5d4b](https://github.com/keymetrics/cli-table/commit/6d5d4b293295e312ad1370e28f409e5a3ff3fc47)) to add array method names in the data set.
- Releases a fix on null/undefined values, [cli-table/#71](https://github.com/Automattic/cli-table/pull/71).
- Lint the code using [standard](https://github.com/standard/standard).
- Use `chalk` instead of `colors`.
- Bump version to stable `1.0.0`

22
api.hyungi.net/node_modules/cli-tableau/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,22 @@
The MIT License (MIT)
Copyright (c) 2011-2017 Automattic
Copyright (c) 2017 Keymetrics
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

131
api.hyungi.net/node_modules/cli-tableau/README.md generated vendored Normal file
View File

@@ -0,0 +1,131 @@
# cli tableau
<a href="https://travis-ci.org/github/keymetrics/cli-tableau" title="PM2 Tests">
<img src="https://travis-ci.org/keymetrics/cli-tableau.svg?branch=master" alt="Build Status"/>
</a>
### Horizontal Tables
```javascript
var Table = require('cli-tableau');
var table = new Table({
head: ['TH 1 label', 'TH 2 label'],
colWidths: [100, 200],
borders: false
});
table.push(
['First value', 'Second value'],
['First value', 'Second value']
);
console.log(table.toString());
```
### Vertical Tables
```javascript
var Table = require('cli-tableau');
var table = new Table();
table.push(
{ 'Some key': 'Some value' },
{ 'Another key': 'Another value' }
);
console.log(table.toString());
```
### Cross Tables
Cross tables are very similar to vertical tables, with two key differences:
1. They require a `head` setting when instantiated that has an empty string as the first header
2. The individual rows take the general form of { "Header": ["Row", "Values"] }
```javascript
var Table = require('cli-tableau');
var table = new Table({ head: ["", "Top Header 1", "Top Header 2"] });
table.push(
{ 'Left Header 1': ['Value Row 1 Col 1', 'Value Row 1 Col 2'] },
{ 'Left Header 2': ['Value Row 2 Col 1', 'Value Row 2 Col 2'] }
);
console.log(table.toString());
```
### Custom styles
The ```chars``` property controls how the table is drawn:
```javascript
var table = new Table({
chars: {
'top': '═' , 'top-mid': '╤' , 'top-left': '╔' , 'top-right': '╗',
'bottom': '═' , 'bottom-mid': '╧' , 'bottom-left': '╚' , 'bottom-right': '╝',
'left': '║' , 'left-mid': '╟' , 'mid': '─' , 'mid-mid': '┼',
'right': '║' , 'right-mid': '╢' , 'middle': '│'
}
});
table.push(
['foo', 'bar', 'baz'],
['frob', 'bar', 'quuz']
);
console.log(table.toString());
// Outputs:
//
//╔══════╤═════╤══════╗
//║ foo │ bar │ baz ║
//╟──────┼─────┼──────╢
//║ frob │ bar │ quuz ║
//╚══════╧═════╧══════╝
```
Empty decoration lines will be skipped, to avoid vertical separator rows just
set the 'mid', 'left-mid', 'mid-mid', 'right-mid' to the empty string:
```javascript
var table = new Table({ chars: {'mid': '', 'left-mid': '', 'mid-mid': '', 'right-mid': ''} });
table.push(
['foo', 'bar', 'baz'],
['frobnicate', 'bar', 'quuz']
);
console.log(table.toString());
// Outputs: (note the lack of the horizontal line between rows)
//┌────────────┬─────┬──────┐
//│ foo │ bar │ baz │
//│ frobnicate │ bar │ quuz │
//└────────────┴─────┴──────┘
```
By setting all chars to empty with the exception of 'middle' being set to a
single space and by setting padding to zero, it's possible to get the most
compact layout with no decorations:
```javascript
var table = new Table({
chars: {
'top': '' , 'top-mid': '' , 'top-left': '' , 'top-right': '',
'bottom': '' , 'bottom-mid': '' , 'bottom-left': '' , 'bottom-right': '',
'left': '' , 'left-mid': '' , 'mid': '' , 'mid-mid': '',
'right': '' , 'right-mid': '' , 'middle': ' '
},
style: { 'padding-left': 0, 'padding-right': 0 }
});
table.push(
['foo', 'bar', 'baz'],
['frobnicate', 'bar', 'quuz']
);
console.log(table.toString());
// Outputs:
//foo bar baz
//frobnicate bar quuz
```
## Credits
- Guillermo Rauch &lt;guillermo@learnboost.com&gt; ([Guille](http://github.com/guille))

316
api.hyungi.net/node_modules/cli-tableau/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,316 @@
/**
* Module dependencies.
*/
var colors = require('chalk')
var utils = require('./utils')
var repeat = utils.repeat
var truncate = utils.truncate
/**
* Table constructor
*
* @param {Object} options
* @api public
*/
function Table (options) {
this.options = utils.options({
chars: {
'top': '─',
'top-mid': '┬',
'top-left': '┌',
'top-right': '┐',
'bottom': '─',
'bottom-mid': '┴',
'bottom-left': '└',
'bottom-right': '┘',
'left': '│',
'left-mid': '├',
'mid': '─',
'mid-mid': '┼',
'right': '│',
'right-mid': '┤',
'middle': '│'
},
truncate: '…',
colWidths: [],
colAligns: [],
style: {
'padding-left': 1,
'padding-right': 1,
head: ['red'],
border: ['grey'],
compact: false
},
head: []
}, options)
if (options.borders == false) {
this.options.chars = {
'top': '',
'top-mid': '',
'top-left': '',
'top-right': '',
'bottom': '',
'bottom-mid': '',
'bottom-left': '',
'bottom-right': '',
'left': '',
'left-mid': '',
'mid': '',
'mid-mid': '',
'right': '',
'right-mid': '',
'middle': ''
}
}
};
/**
* Inherit from Array.
*/
Table.prototype = new Array
/**
* Width getter
*
* @return {Number} width
* @api public
*/
Table.prototype.__defineGetter__('width', function () {
var str = this.toString().split('\n')
if (str.length) return str[0].length
return 0
})
/**
* Render to a string.
*
* @return {String} table representation
* @api public
*/
Table.prototype.render =
Table.prototype.toString = function () {
var ret = ''
var options = this.options
var style = options.style
var head = options.head
var chars = options.chars
var truncater = options.truncate
var colWidths = options.colWidths || new Array(this.head.length)
var totalWidth = 0
if (!head.length && !this.length) return ''
if (!colWidths.length) {
var everyRows = this.slice(0)
if (head.length) { everyRows = everyRows.concat([head]) };
everyRows.forEach(function (cells) {
// horizontal (arrays)
if (Array.isArray(cells) && cells.length) {
extractColumnWidths(cells)
// vertical (objects)
} else {
var headerCell = Object.keys(cells)[0]
var valueCell = cells[headerCell]
colWidths[0] = Math.max(colWidths[0] || 0, getWidth(headerCell) || 0)
// cross (objects w/ array values)
if (Array.isArray(valueCell) && valueCell.length) {
extractColumnWidths(valueCell, 1)
} else {
colWidths[1] = Math.max(colWidths[1] || 0, getWidth(valueCell) || 0)
}
}
})
};
totalWidth = (colWidths.length === 1 ? colWidths[0] : colWidths.reduce(
function (a, b) {
return a + b
})) + colWidths.length + 1
function extractColumnWidths (arr, offset) {
offset = offset || 0
arr.forEach(function (cell, i) {
colWidths[i + offset] = Math.max(colWidths[i + offset] || 0, getWidth(cell) || 0)
})
};
function getWidth (obj) {
return typeof obj === 'object' && obj && obj.width !== undefined
? obj.width
: ((typeof obj === 'object' && obj !== null ? utils.strlen(obj.text) : utils.strlen(obj)) + (style['padding-left'] || 0) + (style['padding-right'] || 0))
}
// draws a line
function line (line, left, right, intersection) {
var width = 0
line = left + repeat(line, totalWidth - 2) + right
colWidths.forEach(function (w, i) {
if (i === colWidths.length - 1) return
width += w + 1
line = line.substr(0, width) + intersection + line.substr(width + 1)
})
return applyStyles(options.style.border, line)
};
// draws the top line
function lineTop () {
var l = line(chars.top,
chars['top-left'] || chars.top,
chars['top-right'] || chars.top,
chars['top-mid'])
if (l) {
ret += l + '\n'
}
};
function generateRow (items, style) {
var cells = []
var maxHeight = 0
// prepare vertical and cross table data
if (!Array.isArray(items) && typeof items === 'object') {
var key = Object.keys(items)[0]
var value = items[key]
var firstCellHead = true
if (Array.isArray(value)) {
items = value
items.unshift(key)
} else {
items = [key, value]
}
}
// transform array of item strings into structure of cells
items.forEach(function (item, i) {
var contents = (item === null || item === undefined ? '' : item).toString().split('\n').reduce(function (memo, l) {
memo.push(string(l, i))
return memo
}, [])
var height = contents.length
if (height > maxHeight) { maxHeight = height };
cells.push({ contents: contents, height: height })
})
// transform vertical cells into horizontal lines
var lines = new Array(maxHeight)
cells.forEach(function (cell, i) {
cell.contents.forEach(function (line, j) {
if (!lines[j]) { lines[j] = [] };
if (style || (firstCellHead && i === 0 && options.style.head)) {
line = applyStyles(options.style.head, line)
}
lines[j].push(line)
})
// populate empty lines in cell
for (var j = cell.height, l = maxHeight; j < l; j++) {
if (!lines[j]) { lines[j] = [] };
lines[j].push(string('', i))
}
})
var ret = ''
lines.forEach(function (line, index) {
if (ret.length > 0) {
ret += '\n' + applyStyles(options.style.border, chars.left)
}
ret += line.join(applyStyles(options.style.border, chars.middle)) + applyStyles(options.style.border, chars.right)
})
return applyStyles(options.style.border, chars.left) + ret
};
function applyStyles (styles, subject) {
if (!subject) {
return ''
}
styles.forEach(function (style) {
subject = colors[style](subject)
})
return subject
};
// renders a string, by padding it or truncating it
function string (str, index) {
str = String(typeof str === 'object' && str.text ? str.text : str)
var length = utils.strlen(str)
var width = colWidths[index] - (style['padding-left'] || 0) - (style['padding-right'] || 0)
var align = options.colAligns[index] || 'left'
return repeat(' ', style['padding-left'] || 0) +
(length === width ? str
: (length < width
? str.padEnd((width + (str.length - length)), ' ', align === 'left' ? 'right'
: (align === 'middle' ? 'both' : 'left'))
: (truncater ? truncate(str, width, truncater) : str))
) +
repeat(' ', style['padding-right'] || 0)
};
if (head.length) {
lineTop()
ret += generateRow(head, style.head) + '\n'
}
if (this.length) {
this.forEach(function (cells, i) {
if (!head.length && i === 0) { lineTop() } else {
if (!style.compact || i < (!!head.length) ? 1 : 0 || cells.length === 0) {
var l = line(chars.mid
, chars['left-mid']
, chars['right-mid']
, chars['mid-mid'])
if (l) { ret += l + '\n' }
}
}
if (Array.isArray(cells) && !cells.length) {
return
} else {
ret += generateRow(cells) + '\n'
};
})
}
var l = line(chars.bottom,
chars['bottom-left'] || chars.bottom,
chars['bottom-right'] || chars.bottom,
chars['bottom-mid'])
if (l) {
ret += l
} else {
// trim the last '\n' if we didn't add the bottom decoration
ret = ret.slice(0, -1)
}
return ret
}
/**
* Module exports.
*/
module.exports = Table
module.exports.version = '2.0.0'

59
api.hyungi.net/node_modules/cli-tableau/lib/utils.js generated vendored Normal file
View File

@@ -0,0 +1,59 @@
/**
* Repeats a string.
*
* @param {String} char(s)
* @param {Number} number of times
* @return {String} repeated string
*/
exports.repeat = function (str, times) {
return Array(times + 1).join(str)
}
/**
* Truncates a string
*
* @api public
*/
exports.truncate = function (str, length, chr) {
chr = chr || '…'
return str.length >= length ? str.substr(0, length - chr.length) + chr : str
}
/**
* Copies and merges options with defaults.
*
* @param {Object} defaults
* @param {Object} supplied options
* @return {Object} new (merged) object
*/
function options (defaults, opts) {
for (var p in opts) {
if (opts[p] && opts[p].constructor && opts[p].constructor === Object) {
defaults[p] = defaults[p] || {}
options(defaults[p], opts[p])
} else {
defaults[p] = opts[p]
}
}
return defaults
};
exports.options = options
//
// For consideration of terminal "color" programs like colors.js,
// which can add ANSI escape color codes to strings,
// we destyle the ANSI color escape codes for padding calculations.
//
// see: http://en.wikipedia.org/wiki/ANSI_escape_code
//
exports.strlen = function (str) {
var code = /\u001b\[(?:\d*;){0,5}\d*m/g
var stripped = ('' + (str != null ? str : '')).replace(code, '')
var split = stripped.split('\n')
return split.reduce(function (memo, s) { return (s.length > memo) ? s.length : memo }, 0)
}

48
api.hyungi.net/node_modules/cli-tableau/package.json generated vendored Normal file
View File

@@ -0,0 +1,48 @@
{
"name": "cli-tableau",
"description": "Pretty unicode tables for the CLI",
"version": "2.0.1",
"engines": {
"node": ">=8.10.0"
},
"author": {
"name": "Guillermo Rauch",
"email": "guillermo@learnboost.com"
},
"contributors": [
{
"name": "Sonny Michaud",
"email": "Michaud.sonny@gmail.com"
}
],
"maintainers": [
{
"name": "soyuka",
"email": "soyuka@gmail.com"
}
],
"repository": {
"type": "git",
"url": "https://github.com/Keymetrics/cli-table.git"
},
"keywords": [
"cli",
"colors",
"table"
],
"dependencies": {
"chalk": "3.0.0"
},
"devDependencies": {
"should": "~0.6",
"mocha": "^7.1.1"
},
"main": "lib",
"files": [
"lib"
],
"scripts": {
"test": "mocha test/*"
},
"licence": "MIT"
}