@aws-solutions-constructs/core 2.76.0 → 2.78.0
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/.jsii +98 -57
- package/lib/alb-defaults.js +2 -3
- package/lib/alb-helper.js +8 -10
- package/lib/apigateway-defaults.d.ts +6 -6
- package/lib/apigateway-defaults.js +17 -18
- package/lib/apigateway-helper.d.ts +2 -2
- package/lib/apigateway-helper.js +14 -17
- package/lib/cloudfront-distribution-defaults.js +4 -5
- package/lib/cloudfront-distribution-helper.js +7 -9
- package/lib/cloudwatch-log-group-defaults.js +2 -3
- package/lib/cloudwatch-log-group-helper.js +3 -6
- package/lib/cognito-defaults.d.ts +2 -2
- package/lib/cognito-defaults.js +6 -6
- package/lib/cognito-helper.js +8 -11
- package/lib/dynamodb-table-defaults.d.ts +3 -3
- package/lib/dynamodb-table-defaults.js +6 -6
- package/lib/dynamodb-table-helper.js +7 -8
- package/lib/elasticache-defaults.js +3 -4
- package/lib/elasticache-helper.js +4 -5
- package/lib/elasticsearch-defaults.js +2 -3
- package/lib/elasticsearch-helper.js +7 -8
- package/lib/eventbridge-helper.d.ts +2 -2
- package/lib/eventbridge-helper.js +6 -7
- package/lib/events-rule-defaults.d.ts +1 -1
- package/lib/events-rule-defaults.js +5 -6
- package/lib/fargate-defaults.js +6 -7
- package/lib/fargate-helper.js +7 -9
- package/lib/glue-database-defaults.js +4 -5
- package/lib/glue-database-helper.js +2 -3
- package/lib/glue-job-defaults.js +2 -3
- package/lib/glue-job-helper.js +9 -9
- package/lib/glue-table-defaults.js +7 -8
- package/lib/glue-table-helper.js +3 -4
- package/lib/iot-topic-rule-defaults.d.ts +1 -1
- package/lib/iot-topic-rule-defaults.js +7 -8
- package/lib/kendra-defaults.js +2 -3
- package/lib/kendra-helper.d.ts +1 -1
- package/lib/kendra-helper.js +5 -6
- package/lib/kinesis-analytics-defaults.d.ts +2 -2
- package/lib/kinesis-analytics-defaults.js +4 -4
- package/lib/kinesis-analytics-helper.js +3 -4
- package/lib/kinesis-firehose-s3-defaults.d.ts +1 -1
- package/lib/kinesis-firehose-s3-defaults.js +8 -9
- package/lib/kinesis-streams-defaults.d.ts +2 -2
- package/lib/kinesis-streams-defaults.js +4 -4
- package/lib/kinesis-streams-helper.js +5 -7
- package/lib/kms-defaults.d.ts +2 -2
- package/lib/kms-defaults.js +4 -4
- package/lib/kms-helper.js +3 -6
- package/lib/lambda-defaults.js +2 -3
- package/lib/lambda-event-source-mapping-defaults.d.ts +3 -3
- package/lib/lambda-event-source-mapping-defaults.js +16 -17
- package/lib/lambda-helper.js +6 -7
- package/lib/mediastore-defaults.js +2 -3
- package/lib/mediastore-helper.js +4 -6
- package/lib/opensearch-defaults.js +2 -3
- package/lib/opensearch-helper.js +5 -6
- package/lib/override-warning-service.js +10 -8
- package/lib/pipes-defaults.js +5 -6
- package/lib/pipes-helper.js +7 -7
- package/lib/s3-bucket-defaults.js +3 -3
- package/lib/s3-bucket-helper.js +13 -8
- package/lib/sagemaker-defaults.js +5 -6
- package/lib/sagemaker-helper.d.ts +5 -0
- package/lib/sagemaker-helper.js +17 -17
- package/lib/secretsmanager-defaults.d.ts +2 -2
- package/lib/secretsmanager-defaults.js +4 -4
- package/lib/secretsmanager-helper.js +4 -6
- package/lib/security-group-helper.js +3 -4
- package/lib/sns-defaults.d.ts +2 -2
- package/lib/sns-defaults.js +4 -4
- package/lib/sns-helper.js +4 -5
- package/lib/sqs-defaults.js +5 -5
- package/lib/sqs-helper.d.ts +1 -1
- package/lib/sqs-helper.js +5 -6
- package/lib/ssm-string-parameter-helper.js +2 -3
- package/lib/step-function-defaults.d.ts +1 -1
- package/lib/step-function-defaults.js +4 -5
- package/lib/step-function-helper.js +5 -5
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +32 -30
- package/lib/vpc-defaults.js +4 -5
- package/lib/vpc-helper.js +6 -8
- package/lib/waf-defaults.js +4 -5
- package/lib/waf-helper.js +4 -6
- package/lib/websocket-api-helper.js +4 -6
- package/package.json +6 -5
- package/test/apigateway-helper.test.js +3 -3
- package/test/cloudfront-distribution-api-gateway-helper.test.js +11 -11
- package/test/dynamo-table.test.js +9 -9
- package/test/glue-job-helper.test.js +7 -7
- package/test/glue-table-helper.test.js +5 -5
- package/test/kinesis-analytics.test.js +2 -2
- package/test/kinesis-streams-defaults.test.js +2 -2
- package/test/lambda-event-source.test.js +10 -10
- package/test/override-warning-service.test.js +25 -26
- package/test/pipes-helper.test.js +2 -2
- package/test/step-function-helper.test.js +5 -5
- package/test/test-helper.js +16 -16
- package/test/utils.test.js +11 -12
- package/.eslintignore +0 -9
- package/node_modules/ansi-regex/index.d.ts +0 -37
- package/node_modules/ansi-regex/index.js +0 -10
- package/node_modules/ansi-regex/license +0 -9
- package/node_modules/ansi-regex/package.json +0 -55
- package/node_modules/ansi-regex/readme.md +0 -78
- package/node_modules/aproba/LICENSE +0 -14
- package/node_modules/aproba/README.md +0 -94
- package/node_modules/aproba/index.js +0 -105
- package/node_modules/aproba/package.json +0 -35
- package/node_modules/are-we-there-yet/LICENSE.md +0 -18
- package/node_modules/are-we-there-yet/README.md +0 -208
- package/node_modules/are-we-there-yet/lib/index.js +0 -4
- package/node_modules/are-we-there-yet/lib/tracker-base.js +0 -13
- package/node_modules/are-we-there-yet/lib/tracker-group.js +0 -112
- package/node_modules/are-we-there-yet/lib/tracker-stream.js +0 -42
- package/node_modules/are-we-there-yet/lib/tracker.js +0 -34
- package/node_modules/are-we-there-yet/package.json +0 -53
- package/node_modules/color-support/LICENSE +0 -15
- package/node_modules/color-support/README.md +0 -129
- package/node_modules/color-support/bin.js +0 -3
- package/node_modules/color-support/browser.js +0 -14
- package/node_modules/color-support/index.js +0 -134
- package/node_modules/color-support/package.json +0 -36
- package/node_modules/console-control-strings/LICENSE +0 -13
- package/node_modules/console-control-strings/README.md +0 -145
- package/node_modules/console-control-strings/index.js +0 -125
- package/node_modules/console-control-strings/package.json +0 -27
- package/node_modules/deep-diff/.circleci/config.yml +0 -76
- package/node_modules/deep-diff/.eslintrc +0 -72
- package/node_modules/deep-diff/.vscode/launch.json +0 -30
- package/node_modules/deep-diff/.vscode/tasks.json +0 -12
- package/node_modules/deep-diff/ChangeLog.md +0 -63
- package/node_modules/deep-diff/LICENSE +0 -7
- package/node_modules/deep-diff/Readme.md +0 -239
- package/node_modules/deep-diff/dist/deep-diff.min.js +0 -1
- package/node_modules/deep-diff/dist/deep-diff.min.js.map +0 -1
- package/node_modules/deep-diff/examples/apply-diff-from-any.js +0 -39
- package/node_modules/deep-diff/examples/array-change.js +0 -45
- package/node_modules/deep-diff/examples/capture_change_apply_elsewhere.js +0 -53
- package/node_modules/deep-diff/examples/diff-ignoring-fun.js +0 -88
- package/node_modules/deep-diff/examples/diff-scenarios.js +0 -49
- package/node_modules/deep-diff/examples/example1.js +0 -41
- package/node_modules/deep-diff/examples/issue-111.js +0 -6
- package/node_modules/deep-diff/examples/issue-113-1.js +0 -14
- package/node_modules/deep-diff/examples/issue-113-2.js +0 -11
- package/node_modules/deep-diff/examples/issue-115.js +0 -17
- package/node_modules/deep-diff/examples/issue-124.js +0 -8
- package/node_modules/deep-diff/examples/issue-125.js +0 -19
- package/node_modules/deep-diff/examples/issue-126.js +0 -33
- package/node_modules/deep-diff/examples/issue-35.js +0 -11
- package/node_modules/deep-diff/examples/issue-47.js +0 -17
- package/node_modules/deep-diff/examples/issue-48.js +0 -48
- package/node_modules/deep-diff/examples/issue-62.js +0 -14
- package/node_modules/deep-diff/examples/issue-70.js +0 -6
- package/node_modules/deep-diff/examples/issue-71.js +0 -15
- package/node_modules/deep-diff/examples/issue-72.js +0 -21
- package/node_modules/deep-diff/examples/issue-74.js +0 -9
- package/node_modules/deep-diff/examples/issue-78.js +0 -24
- package/node_modules/deep-diff/examples/issue-83.js +0 -11
- package/node_modules/deep-diff/examples/issue-88.js +0 -26
- package/node_modules/deep-diff/examples/performance.js +0 -64
- package/node_modules/deep-diff/examples/practice-data.json +0 -2501
- package/node_modules/deep-diff/index.js +0 -526
- package/node_modules/deep-diff/package.json +0 -74
- package/node_modules/deep-diff/test/.eslintrc +0 -10
- package/node_modules/deep-diff/test/tests.html +0 -34
- package/node_modules/deep-diff/test/tests.js +0 -759
- package/node_modules/deepmerge/.editorconfig +0 -7
- package/node_modules/deepmerge/.eslintcache +0 -1
- package/node_modules/deepmerge/changelog.md +0 -167
- package/node_modules/deepmerge/dist/cjs.js +0 -133
- package/node_modules/deepmerge/dist/umd.js +0 -139
- package/node_modules/deepmerge/index.d.ts +0 -20
- package/node_modules/deepmerge/index.js +0 -106
- package/node_modules/deepmerge/license.txt +0 -21
- package/node_modules/deepmerge/package.json +0 -42
- package/node_modules/deepmerge/readme.md +0 -264
- package/node_modules/deepmerge/rollup.config.js +0 -22
- package/node_modules/emoji-regex/LICENSE-MIT.txt +0 -20
- package/node_modules/emoji-regex/README.md +0 -73
- package/node_modules/emoji-regex/es2015/index.js +0 -6
- package/node_modules/emoji-regex/es2015/text.js +0 -6
- package/node_modules/emoji-regex/index.d.ts +0 -23
- package/node_modules/emoji-regex/index.js +0 -6
- package/node_modules/emoji-regex/package.json +0 -50
- package/node_modules/emoji-regex/text.js +0 -6
- package/node_modules/gauge/LICENSE.md +0 -20
- package/node_modules/gauge/README.md +0 -402
- package/node_modules/gauge/lib/base-theme.js +0 -18
- package/node_modules/gauge/lib/error.js +0 -24
- package/node_modules/gauge/lib/has-color.js +0 -4
- package/node_modules/gauge/lib/index.js +0 -289
- package/node_modules/gauge/lib/plumbing.js +0 -50
- package/node_modules/gauge/lib/process.js +0 -3
- package/node_modules/gauge/lib/progress-bar.js +0 -41
- package/node_modules/gauge/lib/render-template.js +0 -222
- package/node_modules/gauge/lib/set-immediate.js +0 -7
- package/node_modules/gauge/lib/set-interval.js +0 -3
- package/node_modules/gauge/lib/spin.js +0 -5
- package/node_modules/gauge/lib/template-item.js +0 -87
- package/node_modules/gauge/lib/theme-set.js +0 -122
- package/node_modules/gauge/lib/themes.js +0 -56
- package/node_modules/gauge/lib/wide-truncate.js +0 -31
- package/node_modules/gauge/package.json +0 -68
- package/node_modules/has-unicode/LICENSE +0 -14
- package/node_modules/has-unicode/README.md +0 -43
- package/node_modules/has-unicode/index.js +0 -16
- package/node_modules/has-unicode/package.json +0 -30
- package/node_modules/is-fullwidth-code-point/index.d.ts +0 -17
- package/node_modules/is-fullwidth-code-point/index.js +0 -50
- package/node_modules/is-fullwidth-code-point/license +0 -9
- package/node_modules/is-fullwidth-code-point/package.json +0 -42
- package/node_modules/is-fullwidth-code-point/readme.md +0 -39
- package/node_modules/npmlog/LICENSE.md +0 -20
- package/node_modules/npmlog/README.md +0 -216
- package/node_modules/npmlog/lib/log.js +0 -400
- package/node_modules/npmlog/package.json +0 -52
- package/node_modules/set-blocking/LICENSE.txt +0 -14
- package/node_modules/set-blocking/README.md +0 -31
- package/node_modules/set-blocking/index.js +0 -7
- package/node_modules/set-blocking/package.json +0 -42
- package/node_modules/signal-exit/LICENSE.txt +0 -16
- package/node_modules/signal-exit/README.md +0 -74
- package/node_modules/signal-exit/dist/cjs/browser.d.ts +0 -12
- package/node_modules/signal-exit/dist/cjs/browser.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/cjs/browser.js +0 -10
- package/node_modules/signal-exit/dist/cjs/browser.js.map +0 -1
- package/node_modules/signal-exit/dist/cjs/index.d.ts +0 -48
- package/node_modules/signal-exit/dist/cjs/index.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/cjs/index.js +0 -279
- package/node_modules/signal-exit/dist/cjs/index.js.map +0 -1
- package/node_modules/signal-exit/dist/cjs/package.json +0 -3
- package/node_modules/signal-exit/dist/cjs/signals.d.ts +0 -29
- package/node_modules/signal-exit/dist/cjs/signals.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/cjs/signals.js +0 -42
- package/node_modules/signal-exit/dist/cjs/signals.js.map +0 -1
- package/node_modules/signal-exit/dist/mjs/browser.d.ts +0 -12
- package/node_modules/signal-exit/dist/mjs/browser.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/mjs/browser.js +0 -4
- package/node_modules/signal-exit/dist/mjs/browser.js.map +0 -1
- package/node_modules/signal-exit/dist/mjs/index.d.ts +0 -48
- package/node_modules/signal-exit/dist/mjs/index.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/mjs/index.js +0 -275
- package/node_modules/signal-exit/dist/mjs/index.js.map +0 -1
- package/node_modules/signal-exit/dist/mjs/package.json +0 -3
- package/node_modules/signal-exit/dist/mjs/signals.d.ts +0 -29
- package/node_modules/signal-exit/dist/mjs/signals.d.ts.map +0 -1
- package/node_modules/signal-exit/dist/mjs/signals.js +0 -39
- package/node_modules/signal-exit/dist/mjs/signals.js.map +0 -1
- package/node_modules/signal-exit/package.json +0 -106
- package/node_modules/string-width/index.d.ts +0 -29
- package/node_modules/string-width/index.js +0 -47
- package/node_modules/string-width/license +0 -9
- package/node_modules/string-width/package.json +0 -56
- package/node_modules/string-width/readme.md +0 -50
- package/node_modules/strip-ansi/index.d.ts +0 -17
- package/node_modules/strip-ansi/index.js +0 -4
- package/node_modules/strip-ansi/license +0 -9
- package/node_modules/strip-ansi/package.json +0 -54
- package/node_modules/strip-ansi/readme.md +0 -46
- package/node_modules/wide-align/LICENSE +0 -14
- package/node_modules/wide-align/README.md +0 -47
- package/node_modules/wide-align/align.js +0 -65
- package/node_modules/wide-align/package.json +0 -33
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
// call it on itself so we can test the export val for basic stuff
|
|
2
|
-
module.exports = colorSupport({ alwaysReturn: true }, colorSupport)
|
|
3
|
-
|
|
4
|
-
function hasNone (obj, options) {
|
|
5
|
-
obj.level = 0
|
|
6
|
-
obj.hasBasic = false
|
|
7
|
-
obj.has256 = false
|
|
8
|
-
obj.has16m = false
|
|
9
|
-
if (!options.alwaysReturn) {
|
|
10
|
-
return false
|
|
11
|
-
}
|
|
12
|
-
return obj
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function hasBasic (obj) {
|
|
16
|
-
obj.hasBasic = true
|
|
17
|
-
obj.has256 = false
|
|
18
|
-
obj.has16m = false
|
|
19
|
-
obj.level = 1
|
|
20
|
-
return obj
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
function has256 (obj) {
|
|
24
|
-
obj.hasBasic = true
|
|
25
|
-
obj.has256 = true
|
|
26
|
-
obj.has16m = false
|
|
27
|
-
obj.level = 2
|
|
28
|
-
return obj
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
function has16m (obj) {
|
|
32
|
-
obj.hasBasic = true
|
|
33
|
-
obj.has256 = true
|
|
34
|
-
obj.has16m = true
|
|
35
|
-
obj.level = 3
|
|
36
|
-
return obj
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
function colorSupport (options, obj) {
|
|
40
|
-
options = options || {}
|
|
41
|
-
|
|
42
|
-
obj = obj || {}
|
|
43
|
-
|
|
44
|
-
// if just requesting a specific level, then return that.
|
|
45
|
-
if (typeof options.level === 'number') {
|
|
46
|
-
switch (options.level) {
|
|
47
|
-
case 0:
|
|
48
|
-
return hasNone(obj, options)
|
|
49
|
-
case 1:
|
|
50
|
-
return hasBasic(obj)
|
|
51
|
-
case 2:
|
|
52
|
-
return has256(obj)
|
|
53
|
-
case 3:
|
|
54
|
-
return has16m(obj)
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
obj.level = 0
|
|
59
|
-
obj.hasBasic = false
|
|
60
|
-
obj.has256 = false
|
|
61
|
-
obj.has16m = false
|
|
62
|
-
|
|
63
|
-
if (typeof process === 'undefined' ||
|
|
64
|
-
!process ||
|
|
65
|
-
!process.stdout ||
|
|
66
|
-
!process.env ||
|
|
67
|
-
!process.platform) {
|
|
68
|
-
return hasNone(obj, options)
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
var env = options.env || process.env
|
|
72
|
-
var stream = options.stream || process.stdout
|
|
73
|
-
var term = options.term || env.TERM || ''
|
|
74
|
-
var platform = options.platform || process.platform
|
|
75
|
-
|
|
76
|
-
if (!options.ignoreTTY && !stream.isTTY) {
|
|
77
|
-
return hasNone(obj, options)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
if (!options.ignoreDumb && term === 'dumb' && !env.COLORTERM) {
|
|
81
|
-
return hasNone(obj, options)
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
if (platform === 'win32') {
|
|
85
|
-
return hasBasic(obj)
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (env.TMUX) {
|
|
89
|
-
return has256(obj)
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
if (!options.ignoreCI && (env.CI || env.TEAMCITY_VERSION)) {
|
|
93
|
-
if (env.TRAVIS) {
|
|
94
|
-
return has256(obj)
|
|
95
|
-
} else {
|
|
96
|
-
return hasNone(obj, options)
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
// TODO: add more term programs
|
|
101
|
-
switch (env.TERM_PROGRAM) {
|
|
102
|
-
case 'iTerm.app':
|
|
103
|
-
var ver = env.TERM_PROGRAM_VERSION || '0.'
|
|
104
|
-
if (/^[0-2]\./.test(ver)) {
|
|
105
|
-
return has256(obj)
|
|
106
|
-
} else {
|
|
107
|
-
return has16m(obj)
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
case 'HyperTerm':
|
|
111
|
-
case 'Hyper':
|
|
112
|
-
return has16m(obj)
|
|
113
|
-
|
|
114
|
-
case 'MacTerm':
|
|
115
|
-
return has16m(obj)
|
|
116
|
-
|
|
117
|
-
case 'Apple_Terminal':
|
|
118
|
-
return has256(obj)
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
if (/^xterm-256/.test(term)) {
|
|
122
|
-
return has256(obj)
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(term)) {
|
|
126
|
-
return hasBasic(obj)
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
if (env.COLORTERM) {
|
|
130
|
-
return hasBasic(obj)
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
return hasNone(obj, options)
|
|
134
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "color-support",
|
|
3
|
-
"version": "1.1.3",
|
|
4
|
-
"description": "A module which will endeavor to guess your terminal's level of color support.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"browser": "browser.js",
|
|
7
|
-
"bin": "bin.js",
|
|
8
|
-
"devDependencies": {
|
|
9
|
-
"tap": "^10.3.3"
|
|
10
|
-
},
|
|
11
|
-
"scripts": {
|
|
12
|
-
"test": "tap test/*.js --100 -J",
|
|
13
|
-
"preversion": "npm test",
|
|
14
|
-
"postversion": "npm publish",
|
|
15
|
-
"postpublish": "git push origin --all; git push origin --tags"
|
|
16
|
-
},
|
|
17
|
-
"repository": {
|
|
18
|
-
"type": "git",
|
|
19
|
-
"url": "git+https://github.com/isaacs/color-support.git"
|
|
20
|
-
},
|
|
21
|
-
"keywords": [
|
|
22
|
-
"terminal",
|
|
23
|
-
"color",
|
|
24
|
-
"support",
|
|
25
|
-
"xterm",
|
|
26
|
-
"truecolor",
|
|
27
|
-
"256"
|
|
28
|
-
],
|
|
29
|
-
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
|
|
30
|
-
"license": "ISC",
|
|
31
|
-
"files": [
|
|
32
|
-
"browser.js",
|
|
33
|
-
"index.js",
|
|
34
|
-
"bin.js"
|
|
35
|
-
]
|
|
36
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
Copyright (c) 2014, Rebecca Turner <me@re-becca.org>
|
|
2
|
-
|
|
3
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
4
|
-
purpose with or without fee is hereby granted, provided that the above
|
|
5
|
-
copyright notice and this permission notice appear in all copies.
|
|
6
|
-
|
|
7
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
8
|
-
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
9
|
-
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
10
|
-
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
11
|
-
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
12
|
-
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
13
|
-
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
@@ -1,145 +0,0 @@
|
|
|
1
|
-
# Console Control Strings
|
|
2
|
-
|
|
3
|
-
A library of cross-platform tested terminal/console command strings for
|
|
4
|
-
doing things like color and cursor positioning. This is a subset of both
|
|
5
|
-
ansi and vt100. All control codes included work on both Windows & Unix-like
|
|
6
|
-
OSes, except where noted.
|
|
7
|
-
|
|
8
|
-
## Usage
|
|
9
|
-
|
|
10
|
-
```js
|
|
11
|
-
var consoleControl = require('console-control-strings')
|
|
12
|
-
|
|
13
|
-
console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset'))
|
|
14
|
-
process.stdout.write(consoleControl.goto(75, 10))
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Why Another?
|
|
18
|
-
|
|
19
|
-
There are tons of libraries similar to this one. I wanted one that was:
|
|
20
|
-
|
|
21
|
-
1. Very clear about compatibility goals.
|
|
22
|
-
2. Could emit, for instance, a start color code without an end one.
|
|
23
|
-
3. Returned strings w/o writing to streams.
|
|
24
|
-
4. Was not weighed down with other unrelated baggage.
|
|
25
|
-
|
|
26
|
-
## Functions
|
|
27
|
-
|
|
28
|
-
### var code = consoleControl.up(_num = 1_)
|
|
29
|
-
|
|
30
|
-
Returns the escape sequence to move _num_ lines up.
|
|
31
|
-
|
|
32
|
-
### var code = consoleControl.down(_num = 1_)
|
|
33
|
-
|
|
34
|
-
Returns the escape sequence to move _num_ lines down.
|
|
35
|
-
|
|
36
|
-
### var code = consoleControl.forward(_num = 1_)
|
|
37
|
-
|
|
38
|
-
Returns the escape sequence to move _num_ lines righ.
|
|
39
|
-
|
|
40
|
-
### var code = consoleControl.back(_num = 1_)
|
|
41
|
-
|
|
42
|
-
Returns the escape sequence to move _num_ lines left.
|
|
43
|
-
|
|
44
|
-
### var code = consoleControl.nextLine(_num = 1_)
|
|
45
|
-
|
|
46
|
-
Returns the escape sequence to move _num_ lines down and to the beginning of
|
|
47
|
-
the line.
|
|
48
|
-
|
|
49
|
-
### var code = consoleControl.previousLine(_num = 1_)
|
|
50
|
-
|
|
51
|
-
Returns the escape sequence to move _num_ lines up and to the beginning of
|
|
52
|
-
the line.
|
|
53
|
-
|
|
54
|
-
### var code = consoleControl.eraseData()
|
|
55
|
-
|
|
56
|
-
Returns the escape sequence to erase everything from the current cursor
|
|
57
|
-
position to the bottom right of the screen. This is line based, so it
|
|
58
|
-
erases the remainder of the current line and all following lines.
|
|
59
|
-
|
|
60
|
-
### var code = consoleControl.eraseLine()
|
|
61
|
-
|
|
62
|
-
Returns the escape sequence to erase to the end of the current line.
|
|
63
|
-
|
|
64
|
-
### var code = consoleControl.goto(_x_, _y_)
|
|
65
|
-
|
|
66
|
-
Returns the escape sequence to move the cursor to the designated position.
|
|
67
|
-
Note that the origin is _1, 1_ not _0, 0_.
|
|
68
|
-
|
|
69
|
-
### var code = consoleControl.gotoSOL()
|
|
70
|
-
|
|
71
|
-
Returns the escape sequence to move the cursor to the beginning of the
|
|
72
|
-
current line. (That is, it returns a carriage return, `\r`.)
|
|
73
|
-
|
|
74
|
-
### var code = consoleControl.beep()
|
|
75
|
-
|
|
76
|
-
Returns the escape sequence to cause the termianl to beep. (That is, it
|
|
77
|
-
returns unicode character `\x0007`, a Control-G.)
|
|
78
|
-
|
|
79
|
-
### var code = consoleControl.hideCursor()
|
|
80
|
-
|
|
81
|
-
Returns the escape sequence to hide the cursor.
|
|
82
|
-
|
|
83
|
-
### var code = consoleControl.showCursor()
|
|
84
|
-
|
|
85
|
-
Returns the escape sequence to show the cursor.
|
|
86
|
-
|
|
87
|
-
### var code = consoleControl.color(_colors = []_)
|
|
88
|
-
|
|
89
|
-
### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_)
|
|
90
|
-
|
|
91
|
-
Returns the escape sequence to set the current terminal display attributes
|
|
92
|
-
(mostly colors). Arguments can either be a list of attributes or an array
|
|
93
|
-
of attributes. The difference between passing in an array or list of colors
|
|
94
|
-
and calling `.color` separately for each one, is that in the former case a
|
|
95
|
-
single escape sequence will be produced where as in the latter each change
|
|
96
|
-
will have its own distinct escape sequence. Each attribute can be one of:
|
|
97
|
-
|
|
98
|
-
* Reset:
|
|
99
|
-
* **reset** – Reset all attributes to the terminal default.
|
|
100
|
-
* Styles:
|
|
101
|
-
* **bold** – Display text as bold. In some terminals this means using a
|
|
102
|
-
bold font, in others this means changing the color. In some it means
|
|
103
|
-
both.
|
|
104
|
-
* **italic** – Display text as italic. This is not available in most Windows terminals.
|
|
105
|
-
* **underline** – Underline text. This is not available in most Windows Terminals.
|
|
106
|
-
* **inverse** – Invert the foreground and background colors.
|
|
107
|
-
* **stopBold** – Do not display text as bold.
|
|
108
|
-
* **stopItalic** – Do not display text as italic.
|
|
109
|
-
* **stopUnderline** – Do not underline text.
|
|
110
|
-
* **stopInverse** – Do not invert foreground and background.
|
|
111
|
-
* Colors:
|
|
112
|
-
* **white**
|
|
113
|
-
* **black**
|
|
114
|
-
* **blue**
|
|
115
|
-
* **cyan**
|
|
116
|
-
* **green**
|
|
117
|
-
* **magenta**
|
|
118
|
-
* **red**
|
|
119
|
-
* **yellow**
|
|
120
|
-
* **grey** / **brightBlack**
|
|
121
|
-
* **brightRed**
|
|
122
|
-
* **brightGreen**
|
|
123
|
-
* **brightYellow**
|
|
124
|
-
* **brightBlue**
|
|
125
|
-
* **brightMagenta**
|
|
126
|
-
* **brightCyan**
|
|
127
|
-
* **brightWhite**
|
|
128
|
-
* Background Colors:
|
|
129
|
-
* **bgWhite**
|
|
130
|
-
* **bgBlack**
|
|
131
|
-
* **bgBlue**
|
|
132
|
-
* **bgCyan**
|
|
133
|
-
* **bgGreen**
|
|
134
|
-
* **bgMagenta**
|
|
135
|
-
* **bgRed**
|
|
136
|
-
* **bgYellow**
|
|
137
|
-
* **bgGrey** / **bgBrightBlack**
|
|
138
|
-
* **bgBrightRed**
|
|
139
|
-
* **bgBrightGreen**
|
|
140
|
-
* **bgBrightYellow**
|
|
141
|
-
* **bgBrightBlue**
|
|
142
|
-
* **bgBrightMagenta**
|
|
143
|
-
* **bgBrightCyan**
|
|
144
|
-
* **bgBrightWhite**
|
|
145
|
-
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
// These tables borrowed from `ansi`
|
|
4
|
-
|
|
5
|
-
var prefix = '\x1b['
|
|
6
|
-
|
|
7
|
-
exports.up = function up (num) {
|
|
8
|
-
return prefix + (num || '') + 'A'
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
exports.down = function down (num) {
|
|
12
|
-
return prefix + (num || '') + 'B'
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
exports.forward = function forward (num) {
|
|
16
|
-
return prefix + (num || '') + 'C'
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
exports.back = function back (num) {
|
|
20
|
-
return prefix + (num || '') + 'D'
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
exports.nextLine = function nextLine (num) {
|
|
24
|
-
return prefix + (num || '') + 'E'
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
exports.previousLine = function previousLine (num) {
|
|
28
|
-
return prefix + (num || '') + 'F'
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
exports.horizontalAbsolute = function horizontalAbsolute (num) {
|
|
32
|
-
if (num == null) throw new Error('horizontalAboslute requires a column to position to')
|
|
33
|
-
return prefix + num + 'G'
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
exports.eraseData = function eraseData () {
|
|
37
|
-
return prefix + 'J'
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
exports.eraseLine = function eraseLine () {
|
|
41
|
-
return prefix + 'K'
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
exports.goto = function (x, y) {
|
|
45
|
-
return prefix + y + ';' + x + 'H'
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
exports.gotoSOL = function () {
|
|
49
|
-
return '\r'
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
exports.beep = function () {
|
|
53
|
-
return '\x07'
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
exports.hideCursor = function hideCursor () {
|
|
57
|
-
return prefix + '?25l'
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
exports.showCursor = function showCursor () {
|
|
61
|
-
return prefix + '?25h'
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
var colors = {
|
|
65
|
-
reset: 0,
|
|
66
|
-
// styles
|
|
67
|
-
bold: 1,
|
|
68
|
-
italic: 3,
|
|
69
|
-
underline: 4,
|
|
70
|
-
inverse: 7,
|
|
71
|
-
// resets
|
|
72
|
-
stopBold: 22,
|
|
73
|
-
stopItalic: 23,
|
|
74
|
-
stopUnderline: 24,
|
|
75
|
-
stopInverse: 27,
|
|
76
|
-
// colors
|
|
77
|
-
white: 37,
|
|
78
|
-
black: 30,
|
|
79
|
-
blue: 34,
|
|
80
|
-
cyan: 36,
|
|
81
|
-
green: 32,
|
|
82
|
-
magenta: 35,
|
|
83
|
-
red: 31,
|
|
84
|
-
yellow: 33,
|
|
85
|
-
bgWhite: 47,
|
|
86
|
-
bgBlack: 40,
|
|
87
|
-
bgBlue: 44,
|
|
88
|
-
bgCyan: 46,
|
|
89
|
-
bgGreen: 42,
|
|
90
|
-
bgMagenta: 45,
|
|
91
|
-
bgRed: 41,
|
|
92
|
-
bgYellow: 43,
|
|
93
|
-
|
|
94
|
-
grey: 90,
|
|
95
|
-
brightBlack: 90,
|
|
96
|
-
brightRed: 91,
|
|
97
|
-
brightGreen: 92,
|
|
98
|
-
brightYellow: 93,
|
|
99
|
-
brightBlue: 94,
|
|
100
|
-
brightMagenta: 95,
|
|
101
|
-
brightCyan: 96,
|
|
102
|
-
brightWhite: 97,
|
|
103
|
-
|
|
104
|
-
bgGrey: 100,
|
|
105
|
-
bgBrightBlack: 100,
|
|
106
|
-
bgBrightRed: 101,
|
|
107
|
-
bgBrightGreen: 102,
|
|
108
|
-
bgBrightYellow: 103,
|
|
109
|
-
bgBrightBlue: 104,
|
|
110
|
-
bgBrightMagenta: 105,
|
|
111
|
-
bgBrightCyan: 106,
|
|
112
|
-
bgBrightWhite: 107
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
exports.color = function color (colorWith) {
|
|
116
|
-
if (arguments.length !== 1 || !Array.isArray(colorWith)) {
|
|
117
|
-
colorWith = Array.prototype.slice.call(arguments)
|
|
118
|
-
}
|
|
119
|
-
return prefix + colorWith.map(colorNameToCode).join(';') + 'm'
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
function colorNameToCode (color) {
|
|
123
|
-
if (colors[color] != null) return colors[color]
|
|
124
|
-
throw new Error('Unknown color or style name: ' + color)
|
|
125
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "console-control-strings",
|
|
3
|
-
"version": "1.1.0",
|
|
4
|
-
"description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.",
|
|
5
|
-
"main": "index.js",
|
|
6
|
-
"directories": {
|
|
7
|
-
"test": "test"
|
|
8
|
-
},
|
|
9
|
-
"scripts": {
|
|
10
|
-
"test": "standard && tap test/*.js"
|
|
11
|
-
},
|
|
12
|
-
"repository": {
|
|
13
|
-
"type": "git",
|
|
14
|
-
"url": "https://github.com/iarna/console-control-strings"
|
|
15
|
-
},
|
|
16
|
-
"keywords": [],
|
|
17
|
-
"author": "Rebecca Turner <me@re-becca.org> (http://re-becca.org/)",
|
|
18
|
-
"license": "ISC",
|
|
19
|
-
"files": [
|
|
20
|
-
"LICENSE",
|
|
21
|
-
"index.js"
|
|
22
|
-
],
|
|
23
|
-
"devDependencies": {
|
|
24
|
-
"standard": "^7.1.2",
|
|
25
|
-
"tap": "^5.7.2"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
version: 2
|
|
2
|
-
jobs:
|
|
3
|
-
build:
|
|
4
|
-
working_directory: ~/repo
|
|
5
|
-
docker:
|
|
6
|
-
- image: circleci/node:8.11.3
|
|
7
|
-
steps:
|
|
8
|
-
- checkout
|
|
9
|
-
- run:
|
|
10
|
-
name: authorize npm
|
|
11
|
-
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
12
|
-
- restore_cache:
|
|
13
|
-
key: dependency-cache-{{ checksum "package.json" }}
|
|
14
|
-
- run:
|
|
15
|
-
name: run npm install
|
|
16
|
-
command: npm install
|
|
17
|
-
- save_cache:
|
|
18
|
-
key: dependency-cache-{{ checksum "package.json" }}
|
|
19
|
-
paths:
|
|
20
|
-
- ./node_modules
|
|
21
|
-
- run: mkdir ~/junit
|
|
22
|
-
- run:
|
|
23
|
-
name: build & test
|
|
24
|
-
command: npm run ci
|
|
25
|
-
when: always
|
|
26
|
-
- run: cp test-results.xml ~/junit/test-results.xml
|
|
27
|
-
- store_test_results:
|
|
28
|
-
path: ~/junit
|
|
29
|
-
- store_artifacts:
|
|
30
|
-
path: ~/junit
|
|
31
|
-
|
|
32
|
-
build_deploy_npm:
|
|
33
|
-
working_directory: ~/repo
|
|
34
|
-
docker:
|
|
35
|
-
- image: circleci/node:8.11.3
|
|
36
|
-
steps:
|
|
37
|
-
- checkout
|
|
38
|
-
- run:
|
|
39
|
-
name: authorize npm
|
|
40
|
-
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
41
|
-
- restore_cache:
|
|
42
|
-
key: dependency-cache-{{ checksum "package.json" }}
|
|
43
|
-
- run:
|
|
44
|
-
name: run npm install
|
|
45
|
-
command: npm install
|
|
46
|
-
- save_cache:
|
|
47
|
-
key: dependency-cache-{{ checksum "package.json" }}
|
|
48
|
-
paths:
|
|
49
|
-
- ./node_modules
|
|
50
|
-
- run: mkdir ~/junit
|
|
51
|
-
- run:
|
|
52
|
-
name: build & test
|
|
53
|
-
command: npm run ci
|
|
54
|
-
when: always
|
|
55
|
-
- run: cp test-results.xml ~/junit/test-results.xml
|
|
56
|
-
- store_test_results:
|
|
57
|
-
path: ~/junit
|
|
58
|
-
- store_artifacts:
|
|
59
|
-
path: ~/junit
|
|
60
|
-
- run:
|
|
61
|
-
name: publish package to npm
|
|
62
|
-
command: npm publish
|
|
63
|
-
|
|
64
|
-
workflows:
|
|
65
|
-
version: 2
|
|
66
|
-
build_deploy:
|
|
67
|
-
jobs:
|
|
68
|
-
- build:
|
|
69
|
-
context: secrets
|
|
70
|
-
- build_deploy_npm:
|
|
71
|
-
context: secrets
|
|
72
|
-
filters:
|
|
73
|
-
tags:
|
|
74
|
-
only: /.*/
|
|
75
|
-
branches:
|
|
76
|
-
ignore: /.*/
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"parserOptions": {
|
|
3
|
-
"sourceType": "module"
|
|
4
|
-
},
|
|
5
|
-
"env": {
|
|
6
|
-
"node": true,
|
|
7
|
-
"browser": true
|
|
8
|
-
},
|
|
9
|
-
"extends": "eslint:recommended",
|
|
10
|
-
"rules": {
|
|
11
|
-
"no-alert": 2,
|
|
12
|
-
"no-array-constructor": 2,
|
|
13
|
-
"no-caller": 2,
|
|
14
|
-
"no-catch-shadow": 2,
|
|
15
|
-
"no-eval": 2,
|
|
16
|
-
"no-extend-native": 2,
|
|
17
|
-
"no-extra-bind": 2,
|
|
18
|
-
"no-implied-eval": 2,
|
|
19
|
-
"no-iterator": 2,
|
|
20
|
-
"no-label-var": 2,
|
|
21
|
-
"no-labels": 2,
|
|
22
|
-
"no-lone-blocks": 2,
|
|
23
|
-
"no-loop-func": 2,
|
|
24
|
-
"no-multi-spaces": 2,
|
|
25
|
-
"no-multi-str": 2,
|
|
26
|
-
"no-native-reassign": 2,
|
|
27
|
-
"no-new": 2,
|
|
28
|
-
"no-new-func": 2,
|
|
29
|
-
"no-new-object": 2,
|
|
30
|
-
"no-new-wrappers": 2,
|
|
31
|
-
"no-octal-escape": 2,
|
|
32
|
-
"no-process-exit": 2,
|
|
33
|
-
"no-proto": 2,
|
|
34
|
-
"no-return-assign": 2,
|
|
35
|
-
"no-script-url": 2,
|
|
36
|
-
"no-sequences": 2,
|
|
37
|
-
"no-shadow": 2,
|
|
38
|
-
"no-shadow-restricted-names": 2,
|
|
39
|
-
"no-spaced-func": 2,
|
|
40
|
-
"no-trailing-spaces": 2,
|
|
41
|
-
"no-undef-init": 2,
|
|
42
|
-
"no-underscore-dangle": 0,
|
|
43
|
-
"no-unused-expressions": 2,
|
|
44
|
-
"no-use-before-define": 2,
|
|
45
|
-
"no-with": 2,
|
|
46
|
-
"camelcase": 1,
|
|
47
|
-
"comma-spacing": 2,
|
|
48
|
-
"consistent-return": 2,
|
|
49
|
-
"curly": [ 2, "all" ],
|
|
50
|
-
"dot-notation": [ 2, { "allowKeywords": true } ],
|
|
51
|
-
"eol-last": 2,
|
|
52
|
-
"no-extra-parens": [ 2, "functions" ],
|
|
53
|
-
"eqeqeq": 2,
|
|
54
|
-
"keyword-spacing": [ 2, { "before": true, "after": true } ],
|
|
55
|
-
"key-spacing": [ 2, { "beforeColon": false, "afterColon": true } ],
|
|
56
|
-
"new-cap": 2,
|
|
57
|
-
"new-parens": 2,
|
|
58
|
-
"quotes": [ 2, "single" ],
|
|
59
|
-
"semi": 2,
|
|
60
|
-
"semi-spacing": [ 2, { "before": false, "after": true } ],
|
|
61
|
-
"space-infix-ops": 2,
|
|
62
|
-
"space-unary-ops": [ 2, { "words": true, "nonwords": false } ],
|
|
63
|
-
"strict": [ 2, "global" ],
|
|
64
|
-
"yoda": [ 2, "never" ]
|
|
65
|
-
},
|
|
66
|
-
"overrides": [
|
|
67
|
-
{
|
|
68
|
-
"files": [ "*.js", "test/*.js" ],
|
|
69
|
-
"excludedFiles": "examples/*.js"
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
// Use IntelliSense to learn about possible attributes.
|
|
3
|
-
// Hover to view descriptions of existing attributes.
|
|
4
|
-
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
-
"version": "0.2.0",
|
|
6
|
-
"configurations": [
|
|
7
|
-
{
|
|
8
|
-
"type": "node",
|
|
9
|
-
"request": "launch",
|
|
10
|
-
"name": "Launch Program",
|
|
11
|
-
"program": "${workspaceFolder}/examples/array-change.js"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"name": "Run mocha",
|
|
15
|
-
"type": "node",
|
|
16
|
-
"request": "launch",
|
|
17
|
-
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
|
|
18
|
-
"stopOnEntry": false,
|
|
19
|
-
"args": [
|
|
20
|
-
"test/**/*.js",
|
|
21
|
-
"--no-timeouts"
|
|
22
|
-
],
|
|
23
|
-
"cwd": "${workspaceRoot}",
|
|
24
|
-
"runtimeExecutable": null,
|
|
25
|
-
"env": {
|
|
26
|
-
"NODE_ENV": "testing"
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
}
|