typespeed 2.0.3 → 2.0.7
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/dist/core.decorator.js +1 -1
- package/dist/core.decorator.js.map +1 -1
- package/dist/scaffold/command.d.ts +1 -0
- package/dist/scaffold/command.js +5 -3
- package/dist/scaffold/command.js.map +1 -1
- package/introduction/decorator/example-import.class.ts +6 -0
- package/introduction/decorator/main-app.ts +6 -0
- package/introduction/decorator/main-decorator.ts +108 -0
- package/introduction/decorator/main-import.ts +1 -0
- package/introduction/decorator/main-reflect.ts +25 -0
- package/introduction/web-services/db-init.ts +39 -0
- package/introduction/web-services/db-singleton.ts +59 -0
- package/introduction/web-services/http-if.ts +10 -0
- package/introduction/web-services/http-init.ts +6 -0
- package/introduction/web-services/http-router.ts +28 -0
- package/package.json +2 -2
- package/src/core.decorator.ts +1 -1
- package/src/scaffold/command.ts +3 -1
- package/test/node_modules/.package-lock.json +62 -0
- package/test/node_modules/@types/node/LICENSE +21 -0
- package/test/node_modules/@types/node/README.md +16 -0
- package/test/node_modules/@types/node/assert/strict.d.ts +8 -0
- package/test/node_modules/@types/node/assert.d.ts +961 -0
- package/test/node_modules/@types/node/async_hooks.d.ts +518 -0
- package/test/node_modules/@types/node/buffer.d.ts +2320 -0
- package/test/node_modules/@types/node/child_process.d.ts +1372 -0
- package/test/node_modules/@types/node/cluster.d.ts +410 -0
- package/test/node_modules/@types/node/console.d.ts +412 -0
- package/test/node_modules/@types/node/constants.d.ts +18 -0
- package/test/node_modules/@types/node/crypto.d.ts +3973 -0
- package/test/node_modules/@types/node/dgram.d.ts +545 -0
- package/test/node_modules/@types/node/diagnostics_channel.d.ts +192 -0
- package/test/node_modules/@types/node/dns/promises.d.ts +370 -0
- package/test/node_modules/@types/node/dns.d.ts +660 -0
- package/test/node_modules/@types/node/dom-events.d.ts +126 -0
- package/test/node_modules/@types/node/domain.d.ts +170 -0
- package/test/node_modules/@types/node/events.d.ts +682 -0
- package/test/node_modules/@types/node/fs/promises.d.ts +1159 -0
- package/test/node_modules/@types/node/fs.d.ts +3976 -0
- package/test/node_modules/@types/node/globals.d.ts +302 -0
- package/test/node_modules/@types/node/globals.global.d.ts +1 -0
- package/test/node_modules/@types/node/http.d.ts +1714 -0
- package/test/node_modules/@types/node/http2.d.ts +2133 -0
- package/test/node_modules/@types/node/https.d.ts +542 -0
- package/test/node_modules/@types/node/index.d.ts +134 -0
- package/test/node_modules/@types/node/inspector.d.ts +2741 -0
- package/test/node_modules/@types/node/module.d.ts +115 -0
- package/test/node_modules/@types/node/net.d.ts +883 -0
- package/test/node_modules/@types/node/os.d.ts +473 -0
- package/test/node_modules/@types/node/package.json +237 -0
- package/test/node_modules/@types/node/path.d.ts +191 -0
- package/test/node_modules/@types/node/perf_hooks.d.ts +625 -0
- package/test/node_modules/@types/node/process.d.ts +1488 -0
- package/test/node_modules/@types/node/punycode.d.ts +117 -0
- package/test/node_modules/@types/node/querystring.d.ts +131 -0
- package/test/node_modules/@types/node/readline/promises.d.ts +143 -0
- package/test/node_modules/@types/node/readline.d.ts +653 -0
- package/test/node_modules/@types/node/repl.d.ts +424 -0
- package/test/node_modules/@types/node/stream/consumers.d.ts +12 -0
- package/test/node_modules/@types/node/stream/promises.d.ts +42 -0
- package/test/node_modules/@types/node/stream/web.d.ts +330 -0
- package/test/node_modules/@types/node/stream.d.ts +1440 -0
- package/test/node_modules/@types/node/string_decoder.d.ts +67 -0
- package/test/node_modules/@types/node/test.d.ts +760 -0
- package/test/node_modules/@types/node/timers/promises.d.ts +93 -0
- package/test/node_modules/@types/node/timers.d.ts +101 -0
- package/test/node_modules/@types/node/tls.d.ts +1111 -0
- package/test/node_modules/@types/node/trace_events.d.ts +171 -0
- package/test/node_modules/@types/node/ts4.8/assert/strict.d.ts +8 -0
- package/test/node_modules/@types/node/ts4.8/assert.d.ts +961 -0
- package/test/node_modules/@types/node/ts4.8/async_hooks.d.ts +518 -0
- package/test/node_modules/@types/node/ts4.8/buffer.d.ts +2320 -0
- package/test/node_modules/@types/node/ts4.8/child_process.d.ts +1372 -0
- package/test/node_modules/@types/node/ts4.8/cluster.d.ts +410 -0
- package/test/node_modules/@types/node/ts4.8/console.d.ts +412 -0
- package/test/node_modules/@types/node/ts4.8/constants.d.ts +18 -0
- package/test/node_modules/@types/node/ts4.8/crypto.d.ts +3972 -0
- package/test/node_modules/@types/node/ts4.8/dgram.d.ts +545 -0
- package/test/node_modules/@types/node/ts4.8/diagnostics_channel.d.ts +192 -0
- package/test/node_modules/@types/node/ts4.8/dns/promises.d.ts +370 -0
- package/test/node_modules/@types/node/ts4.8/dns.d.ts +660 -0
- package/test/node_modules/@types/node/ts4.8/dom-events.d.ts +126 -0
- package/test/node_modules/@types/node/ts4.8/domain.d.ts +170 -0
- package/test/node_modules/@types/node/ts4.8/events.d.ts +682 -0
- package/test/node_modules/@types/node/ts4.8/fs/promises.d.ts +1138 -0
- package/test/node_modules/@types/node/ts4.8/fs.d.ts +3875 -0
- package/test/node_modules/@types/node/ts4.8/globals.d.ts +301 -0
- package/test/node_modules/@types/node/ts4.8/globals.global.d.ts +1 -0
- package/test/node_modules/@types/node/ts4.8/http.d.ts +1651 -0
- package/test/node_modules/@types/node/ts4.8/http2.d.ts +2133 -0
- package/test/node_modules/@types/node/ts4.8/https.d.ts +542 -0
- package/test/node_modules/@types/node/ts4.8/index.d.ts +88 -0
- package/test/node_modules/@types/node/ts4.8/inspector.d.ts +2741 -0
- package/test/node_modules/@types/node/ts4.8/module.d.ts +115 -0
- package/test/node_modules/@types/node/ts4.8/net.d.ts +883 -0
- package/test/node_modules/@types/node/ts4.8/os.d.ts +473 -0
- package/test/node_modules/@types/node/ts4.8/path.d.ts +191 -0
- package/test/node_modules/@types/node/ts4.8/perf_hooks.d.ts +625 -0
- package/test/node_modules/@types/node/ts4.8/process.d.ts +1488 -0
- package/test/node_modules/@types/node/ts4.8/punycode.d.ts +117 -0
- package/test/node_modules/@types/node/ts4.8/querystring.d.ts +131 -0
- package/test/node_modules/@types/node/ts4.8/readline/promises.d.ts +143 -0
- package/test/node_modules/@types/node/ts4.8/readline.d.ts +653 -0
- package/test/node_modules/@types/node/ts4.8/repl.d.ts +424 -0
- package/test/node_modules/@types/node/ts4.8/stream/consumers.d.ts +12 -0
- package/test/node_modules/@types/node/ts4.8/stream/promises.d.ts +42 -0
- package/test/node_modules/@types/node/ts4.8/stream/web.d.ts +330 -0
- package/test/node_modules/@types/node/ts4.8/stream.d.ts +1440 -0
- package/test/node_modules/@types/node/ts4.8/string_decoder.d.ts +67 -0
- package/test/node_modules/@types/node/ts4.8/test.d.ts +760 -0
- package/test/node_modules/@types/node/ts4.8/timers/promises.d.ts +93 -0
- package/test/node_modules/@types/node/ts4.8/timers.d.ts +94 -0
- package/test/node_modules/@types/node/ts4.8/tls.d.ts +1111 -0
- package/test/node_modules/@types/node/ts4.8/trace_events.d.ts +171 -0
- package/test/node_modules/@types/node/ts4.8/tty.d.ts +206 -0
- package/test/node_modules/@types/node/ts4.8/url.d.ts +902 -0
- package/test/node_modules/@types/node/ts4.8/util.d.ts +2017 -0
- package/test/node_modules/@types/node/ts4.8/v8.d.ts +541 -0
- package/test/node_modules/@types/node/ts4.8/vm.d.ts +644 -0
- package/test/node_modules/@types/node/ts4.8/wasi.d.ts +158 -0
- package/test/node_modules/@types/node/ts4.8/worker_threads.d.ts +695 -0
- package/test/node_modules/@types/node/ts4.8/zlib.d.ts +517 -0
- package/test/node_modules/@types/node/tty.d.ts +206 -0
- package/test/node_modules/@types/node/url.d.ts +902 -0
- package/test/node_modules/@types/node/util.d.ts +2017 -0
- package/test/node_modules/@types/node/v8.d.ts +541 -0
- package/test/node_modules/@types/node/vm.d.ts +644 -0
- package/test/node_modules/@types/node/wasi.d.ts +158 -0
- package/test/node_modules/@types/node/worker_threads.d.ts +695 -0
- package/test/node_modules/@types/node/zlib.d.ts +517 -0
- package/test/node_modules/colors/LICENSE +25 -0
- package/test/node_modules/colors/README.md +221 -0
- package/test/node_modules/colors/examples/normal-usage.js +82 -0
- package/test/node_modules/colors/examples/safe-string.js +79 -0
- package/test/node_modules/colors/index.d.ts +136 -0
- package/test/node_modules/colors/lib/colors.js +211 -0
- package/test/node_modules/colors/lib/custom/trap.js +46 -0
- package/test/node_modules/colors/lib/custom/zalgo.js +110 -0
- package/test/node_modules/colors/lib/extendStringPrototype.js +110 -0
- package/test/node_modules/colors/lib/index.js +13 -0
- package/test/node_modules/colors/lib/maps/america.js +10 -0
- package/test/node_modules/colors/lib/maps/rainbow.js +12 -0
- package/test/node_modules/colors/lib/maps/random.js +11 -0
- package/test/node_modules/colors/lib/maps/zebra.js +5 -0
- package/test/node_modules/colors/lib/styles.js +95 -0
- package/test/node_modules/colors/lib/system/has-flag.js +35 -0
- package/test/node_modules/colors/lib/system/supports-colors.js +151 -0
- package/test/node_modules/colors/package.json +45 -0
- package/test/node_modules/colors/safe.d.ts +48 -0
- package/test/node_modules/colors/safe.js +10 -0
- package/test/node_modules/colors/themes/generic-logging.js +12 -0
- package/test/node_modules/dateformat/LICENSE +20 -0
- package/test/node_modules/dateformat/Readme.md +204 -0
- package/test/node_modules/dateformat/lib/dateformat.js +1 -0
- package/test/node_modules/dateformat/package.json +38 -0
- package/test/node_modules/mkdirp/CHANGELOG.md +15 -0
- package/test/node_modules/mkdirp/LICENSE +21 -0
- package/test/node_modules/mkdirp/bin/cmd.js +68 -0
- package/test/node_modules/mkdirp/index.js +31 -0
- package/test/node_modules/mkdirp/lib/find-made.js +29 -0
- package/test/node_modules/mkdirp/lib/mkdirp-manual.js +64 -0
- package/test/node_modules/mkdirp/lib/mkdirp-native.js +39 -0
- package/test/node_modules/mkdirp/lib/opts-arg.js +23 -0
- package/test/node_modules/mkdirp/lib/path-arg.js +29 -0
- package/test/node_modules/mkdirp/lib/use-native.js +10 -0
- package/test/node_modules/mkdirp/package.json +44 -0
- package/test/node_modules/mkdirp/readme.markdown +266 -0
- package/test/node_modules/tinytim/.travis.yml +5 -0
- package/test/node_modules/tinytim/README.md +212 -0
- package/test/node_modules/tinytim/index.js +1 -0
- package/test/node_modules/tinytim/lib/index.js +55 -0
- package/test/node_modules/tinytim/lib/tinytim.js +50 -0
- package/test/node_modules/tinytim/package.json +24 -0
- package/test/node_modules/tinytim/test/files/html.tim +1 -0
- package/test/node_modules/tinytim/test/files/string.tim +1 -0
- package/test/node_modules/tinytim/test/files/string2.tim +1 -0
- package/test/node_modules/tinytim/test/render-file-replace.js +39 -0
- package/test/node_modules/tinytim/test/render-replace.js +94 -0
- package/test/node_modules/tinytim/test/tim-replace.js +95 -0
- package/test/node_modules/tracer/README.md +747 -0
- package/test/node_modules/tracer/lib/color_console.js +15 -0
- package/test/node_modules/tracer/lib/console.js +165 -0
- package/test/node_modules/tracer/lib/dailyfile.js +92 -0
- package/test/node_modules/tracer/lib/index.js +10 -0
- package/test/node_modules/tracer/lib/settings.js +25 -0
- package/test/node_modules/tracer/lib/utils.js +58 -0
- package/test/node_modules/tracer/package.json +53 -0
- package/test/node_modules/tracer/types/index.d.ts +189 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
The MIT License (MIT)
|
|
3
|
+
|
|
4
|
+
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in
|
|
14
|
+
all copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
22
|
+
THE SOFTWARE.
|
|
23
|
+
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
'use strict';
|
|
27
|
+
|
|
28
|
+
var os = require('os');
|
|
29
|
+
var hasFlag = require('./has-flag.js');
|
|
30
|
+
|
|
31
|
+
var env = process.env;
|
|
32
|
+
|
|
33
|
+
var forceColor = void 0;
|
|
34
|
+
if (hasFlag('no-color') || hasFlag('no-colors') || hasFlag('color=false')) {
|
|
35
|
+
forceColor = false;
|
|
36
|
+
} else if (hasFlag('color') || hasFlag('colors') || hasFlag('color=true')
|
|
37
|
+
|| hasFlag('color=always')) {
|
|
38
|
+
forceColor = true;
|
|
39
|
+
}
|
|
40
|
+
if ('FORCE_COLOR' in env) {
|
|
41
|
+
forceColor = env.FORCE_COLOR.length === 0
|
|
42
|
+
|| parseInt(env.FORCE_COLOR, 10) !== 0;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function translateLevel(level) {
|
|
46
|
+
if (level === 0) {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
level: level,
|
|
52
|
+
hasBasic: true,
|
|
53
|
+
has256: level >= 2,
|
|
54
|
+
has16m: level >= 3,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function supportsColor(stream) {
|
|
59
|
+
if (forceColor === false) {
|
|
60
|
+
return 0;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
if (hasFlag('color=16m') || hasFlag('color=full')
|
|
64
|
+
|| hasFlag('color=truecolor')) {
|
|
65
|
+
return 3;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
if (hasFlag('color=256')) {
|
|
69
|
+
return 2;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
if (stream && !stream.isTTY && forceColor !== true) {
|
|
73
|
+
return 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
var min = forceColor ? 1 : 0;
|
|
77
|
+
|
|
78
|
+
if (process.platform === 'win32') {
|
|
79
|
+
// Node.js 7.5.0 is the first version of Node.js to include a patch to
|
|
80
|
+
// libuv that enables 256 color output on Windows. Anything earlier and it
|
|
81
|
+
// won't work. However, here we target Node.js 8 at minimum as it is an LTS
|
|
82
|
+
// release, and Node.js 7 is not. Windows 10 build 10586 is the first
|
|
83
|
+
// Windows release that supports 256 colors. Windows 10 build 14931 is the
|
|
84
|
+
// first release that supports 16m/TrueColor.
|
|
85
|
+
var osRelease = os.release().split('.');
|
|
86
|
+
if (Number(process.versions.node.split('.')[0]) >= 8
|
|
87
|
+
&& Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
88
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return 1;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if ('CI' in env) {
|
|
95
|
+
if (['TRAVIS', 'CIRCLECI', 'APPVEYOR', 'GITLAB_CI'].some(function(sign) {
|
|
96
|
+
return sign in env;
|
|
97
|
+
}) || env.CI_NAME === 'codeship') {
|
|
98
|
+
return 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return min;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
if ('TEAMCITY_VERSION' in env) {
|
|
105
|
+
return (/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0
|
|
106
|
+
);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if ('TERM_PROGRAM' in env) {
|
|
110
|
+
var version = parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);
|
|
111
|
+
|
|
112
|
+
switch (env.TERM_PROGRAM) {
|
|
113
|
+
case 'iTerm.app':
|
|
114
|
+
return version >= 3 ? 3 : 2;
|
|
115
|
+
case 'Hyper':
|
|
116
|
+
return 3;
|
|
117
|
+
case 'Apple_Terminal':
|
|
118
|
+
return 2;
|
|
119
|
+
// No default
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
124
|
+
return 2;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
if (/^screen|^xterm|^vt100|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
128
|
+
return 1;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if ('COLORTERM' in env) {
|
|
132
|
+
return 1;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
if (env.TERM === 'dumb') {
|
|
136
|
+
return min;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return min;
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
function getSupportLevel(stream) {
|
|
143
|
+
var level = supportsColor(stream);
|
|
144
|
+
return translateLevel(level);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
module.exports = {
|
|
148
|
+
supportsColor: getSupportLevel,
|
|
149
|
+
stdout: getSupportLevel(process.stdout),
|
|
150
|
+
stderr: getSupportLevel(process.stderr),
|
|
151
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "colors",
|
|
3
|
+
"description": "get colors in your node.js console",
|
|
4
|
+
"version": "1.4.0",
|
|
5
|
+
"author": "Marak Squires",
|
|
6
|
+
"contributors": [
|
|
7
|
+
{
|
|
8
|
+
"name": "DABH",
|
|
9
|
+
"url": "https://github.com/DABH"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"homepage": "https://github.com/Marak/colors.js",
|
|
13
|
+
"bugs": "https://github.com/Marak/colors.js/issues",
|
|
14
|
+
"keywords": [
|
|
15
|
+
"ansi",
|
|
16
|
+
"terminal",
|
|
17
|
+
"colors"
|
|
18
|
+
],
|
|
19
|
+
"repository": {
|
|
20
|
+
"type": "git",
|
|
21
|
+
"url": "http://github.com/Marak/colors.js.git"
|
|
22
|
+
},
|
|
23
|
+
"license": "MIT",
|
|
24
|
+
"scripts": {
|
|
25
|
+
"lint": "eslint . --fix",
|
|
26
|
+
"test": "node tests/basic-test.js && node tests/safe-test.js"
|
|
27
|
+
},
|
|
28
|
+
"engines": {
|
|
29
|
+
"node": ">=0.1.90"
|
|
30
|
+
},
|
|
31
|
+
"main": "lib/index.js",
|
|
32
|
+
"files": [
|
|
33
|
+
"examples",
|
|
34
|
+
"lib",
|
|
35
|
+
"LICENSE",
|
|
36
|
+
"safe.js",
|
|
37
|
+
"themes",
|
|
38
|
+
"index.d.ts",
|
|
39
|
+
"safe.d.ts"
|
|
40
|
+
],
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"eslint": "^5.2.0",
|
|
43
|
+
"eslint-config-google": "^0.11.0"
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Type definitions for Colors.js 1.2
|
|
2
|
+
// Project: https://github.com/Marak/colors.js
|
|
3
|
+
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Staffan Eketorp <https://github.com/staeke>
|
|
4
|
+
// Definitions: https://github.com/Marak/colors.js
|
|
5
|
+
|
|
6
|
+
export const enabled: boolean;
|
|
7
|
+
export function enable(): void;
|
|
8
|
+
export function disable(): void;
|
|
9
|
+
export function setTheme(theme: any): void;
|
|
10
|
+
|
|
11
|
+
export function strip(str: string): string;
|
|
12
|
+
export function stripColors(str: string): string;
|
|
13
|
+
|
|
14
|
+
export function black(str: string): string;
|
|
15
|
+
export function red(str: string): string;
|
|
16
|
+
export function green(str: string): string;
|
|
17
|
+
export function yellow(str: string): string;
|
|
18
|
+
export function blue(str: string): string;
|
|
19
|
+
export function magenta(str: string): string;
|
|
20
|
+
export function cyan(str: string): string;
|
|
21
|
+
export function white(str: string): string;
|
|
22
|
+
export function gray(str: string): string;
|
|
23
|
+
export function grey(str: string): string;
|
|
24
|
+
|
|
25
|
+
export function bgBlack(str: string): string;
|
|
26
|
+
export function bgRed(str: string): string;
|
|
27
|
+
export function bgGreen(str: string): string;
|
|
28
|
+
export function bgYellow(str: string): string;
|
|
29
|
+
export function bgBlue(str: string): string;
|
|
30
|
+
export function bgMagenta(str: string): string;
|
|
31
|
+
export function bgCyan(str: string): string;
|
|
32
|
+
export function bgWhite(str: string): string;
|
|
33
|
+
|
|
34
|
+
export function reset(str: string): string;
|
|
35
|
+
export function bold(str: string): string;
|
|
36
|
+
export function dim(str: string): string;
|
|
37
|
+
export function italic(str: string): string;
|
|
38
|
+
export function underline(str: string): string;
|
|
39
|
+
export function inverse(str: string): string;
|
|
40
|
+
export function hidden(str: string): string;
|
|
41
|
+
export function strikethrough(str: string): string;
|
|
42
|
+
|
|
43
|
+
export function rainbow(str: string): string;
|
|
44
|
+
export function zebra(str: string): string;
|
|
45
|
+
export function america(str: string): string;
|
|
46
|
+
export function trap(str: string): string;
|
|
47
|
+
export function random(str: string): string;
|
|
48
|
+
export function zalgo(str: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Remark: Requiring this file will use the "safe" colors API,
|
|
3
|
+
// which will not touch String.prototype.
|
|
4
|
+
//
|
|
5
|
+
// var colors = require('colors/safe');
|
|
6
|
+
// colors.red("foo")
|
|
7
|
+
//
|
|
8
|
+
//
|
|
9
|
+
var colors = require('./lib/colors');
|
|
10
|
+
module['exports'] = colors;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
(c) 2007-2009 Steven Levithan <stevenlevithan.com>
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
|
+
a copy of this software and associated documentation files (the
|
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
9
|
+
the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be
|
|
12
|
+
included in all copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
# dateformat
|
|
2
|
+
|
|
3
|
+
A node.js package for Steven Levithan's excellent [dateFormat()][dateformat] function.
|
|
4
|
+
|
|
5
|
+
[](https://travis-ci.org/felixge/node-dateformat)
|
|
6
|
+
|
|
7
|
+
## Modifications
|
|
8
|
+
|
|
9
|
+
- Removed the `Date.prototype.format` method. Sorry folks, but extending native prototypes is for suckers.
|
|
10
|
+
- Added a `module.exports = dateFormat;` statement at the bottom
|
|
11
|
+
- Added the placeholder `N` to get the ISO 8601 numeric representation of the day of the week
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
$ npm install dateformat
|
|
17
|
+
$ dateformat --help
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
As taken from Steven's post, modified to match the Modifications listed above:
|
|
23
|
+
|
|
24
|
+
```js
|
|
25
|
+
var dateFormat = require("dateformat");
|
|
26
|
+
var now = new Date();
|
|
27
|
+
|
|
28
|
+
// Basic usage
|
|
29
|
+
dateFormat(now, "dddd, mmmm dS, yyyy, h:MM:ss TT");
|
|
30
|
+
// Saturday, June 9th, 2007, 5:46:21 PM
|
|
31
|
+
|
|
32
|
+
// You can use one of several named masks
|
|
33
|
+
dateFormat(now, "isoDateTime");
|
|
34
|
+
// 2007-06-09T17:46:21
|
|
35
|
+
|
|
36
|
+
// ...Or add your own
|
|
37
|
+
dateFormat.masks.hammerTime = 'HH:MM! "Can\'t touch this!"';
|
|
38
|
+
dateFormat(now, "hammerTime");
|
|
39
|
+
// 17:46! Can't touch this!
|
|
40
|
+
|
|
41
|
+
// You can also provide the date as a string
|
|
42
|
+
dateFormat("Jun 9 2007", "fullDate");
|
|
43
|
+
// Saturday, June 9, 2007
|
|
44
|
+
|
|
45
|
+
// Note that if you don't include the mask argument,
|
|
46
|
+
// dateFormat.masks.default is used
|
|
47
|
+
dateFormat(now);
|
|
48
|
+
// Sat Jun 09 2007 17:46:21
|
|
49
|
+
|
|
50
|
+
// And if you don't include the date argument,
|
|
51
|
+
// the current date and time is used
|
|
52
|
+
dateFormat();
|
|
53
|
+
// Sat Jun 09 2007 17:46:22
|
|
54
|
+
|
|
55
|
+
// You can also skip the date argument (as long as your mask doesn't
|
|
56
|
+
// contain any numbers), in which case the current date/time is used
|
|
57
|
+
dateFormat("longTime");
|
|
58
|
+
// 5:46:22 PM EST
|
|
59
|
+
|
|
60
|
+
// And finally, you can convert local time to UTC time. Simply pass in
|
|
61
|
+
// true as an additional argument (no argument skipping allowed in this case):
|
|
62
|
+
dateFormat(now, "longTime", true);
|
|
63
|
+
// 10:46:21 PM UTC
|
|
64
|
+
|
|
65
|
+
// ...Or add the prefix "UTC:" or "GMT:" to your mask.
|
|
66
|
+
dateFormat(now, "UTC:h:MM:ss TT Z");
|
|
67
|
+
// 10:46:21 PM UTC
|
|
68
|
+
|
|
69
|
+
// You can also get the ISO 8601 week of the year:
|
|
70
|
+
dateFormat(now, "W");
|
|
71
|
+
// 42
|
|
72
|
+
|
|
73
|
+
// and also get the ISO 8601 numeric representation of the day of the week:
|
|
74
|
+
dateFormat(now, "N");
|
|
75
|
+
// 6
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### Mask options
|
|
79
|
+
|
|
80
|
+
| Mask | Description |
|
|
81
|
+
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
82
|
+
| `d` | Day of the month as digits; no leading zero for single-digit days. |
|
|
83
|
+
| `dd` | Day of the month as digits; leading zero for single-digit days. |
|
|
84
|
+
| `ddd` | Day of the week as a three-letter abbreviation. |
|
|
85
|
+
| `DDD` | "Ysd", "Tdy" or "Tmw" if date lies within these three days. Else fall back to ddd. |
|
|
86
|
+
| `dddd` | Day of the week as its full name. |
|
|
87
|
+
| `DDDD` | "Yesterday", "Today" or "Tomorrow" if date lies within these three days. Else fall back to dddd. |
|
|
88
|
+
| `m` | Month as digits; no leading zero for single-digit months. |
|
|
89
|
+
| `mm` | Month as digits; leading zero for single-digit months. |
|
|
90
|
+
| `mmm` | Month as a three-letter abbreviation. |
|
|
91
|
+
| `mmmm` | Month as its full name. |
|
|
92
|
+
| `yy` | Year as last two digits; leading zero for years less than 10. |
|
|
93
|
+
| `yyyy` | Year represented by four digits. |
|
|
94
|
+
| `h` | Hours; no leading zero for single-digit hours (12-hour clock). |
|
|
95
|
+
| `hh` | Hours; leading zero for single-digit hours (12-hour clock). |
|
|
96
|
+
| `H` | Hours; no leading zero for single-digit hours (24-hour clock). |
|
|
97
|
+
| `HH` | Hours; leading zero for single-digit hours (24-hour clock). |
|
|
98
|
+
| `M` | Minutes; no leading zero for single-digit minutes. |
|
|
99
|
+
| `MM` | Minutes; leading zero for single-digit minutes. |
|
|
100
|
+
| `N` | ISO 8601 numeric representation of the day of the week. |
|
|
101
|
+
| `o` | GMT/UTC timezone offset, e.g. -0500 or +0230. |
|
|
102
|
+
| `p` | GMT/UTC timezone offset, e.g. -05:00 or +02:30. |
|
|
103
|
+
| `s` | Seconds; no leading zero for single-digit seconds. |
|
|
104
|
+
| `ss` | Seconds; leading zero for single-digit seconds. |
|
|
105
|
+
| `S` | The date's ordinal suffix (st, nd, rd, or th). Works well with `d`. |
|
|
106
|
+
| `l` | Milliseconds; gives 3 digits. |
|
|
107
|
+
| `L` | Milliseconds; gives 2 digits. |
|
|
108
|
+
| `t` | Lowercase, single-character time marker string: a or p. |
|
|
109
|
+
| `tt` | Lowercase, two-character time marker string: am or pm. |
|
|
110
|
+
| `T` | Uppercase, single-character time marker string: A or P. |
|
|
111
|
+
| `TT` | Uppercase, two-character time marker string: AM or PM. |
|
|
112
|
+
| `W` | ISO 8601 week number of the year, e.g. 4, 42 |
|
|
113
|
+
| `WW` | ISO 8601 week number of the year, leading zero for single-digit, e.g. 04, 42 |
|
|
114
|
+
| `Z` | US timezone abbreviation, e.g. EST or MDT. For non-US timezones, the GMT/UTC offset is returned, e.g. GMT-0500 |
|
|
115
|
+
| `'...'`, `"..."` | Literal character sequence. Surrounding quotes are removed. |
|
|
116
|
+
| `UTC:` | Must be the first four characters of the mask. Converts the date from local time to UTC/GMT/Zulu time before applying the mask. The "UTC:" prefix is removed. |
|
|
117
|
+
|
|
118
|
+
### Named Formats
|
|
119
|
+
|
|
120
|
+
| Name | Mask | Example |
|
|
121
|
+
| ----------------- | ------------------------------ | ------------------------ |
|
|
122
|
+
| `default` | `ddd mmm dd yyyy HH:MM:ss` | Sat Jun 09 2007 17:46:21 |
|
|
123
|
+
| `shortDate` | `m/d/yy` | 6/9/07 |
|
|
124
|
+
| `paddedShortDate` | `mm/dd/yyyy` | 06/09/2007 |
|
|
125
|
+
| `mediumDate` | `mmm d, yyyy` | Jun 9, 2007 |
|
|
126
|
+
| `longDate` | `mmmm d, yyyy` | June 9, 2007 |
|
|
127
|
+
| `fullDate` | `dddd, mmmm d, yyyy` | Saturday, June 9, 2007 |
|
|
128
|
+
| `shortTime` | `h:MM TT` | 5:46 PM |
|
|
129
|
+
| `mediumTime` | `h:MM:ss TT` | 5:46:21 PM |
|
|
130
|
+
| `longTime` | `h:MM:ss TT Z` | 5:46:21 PM EST |
|
|
131
|
+
| `isoDate` | `yyyy-mm-dd` | 2007-06-09 |
|
|
132
|
+
| `isoTime` | `HH:MM:ss` | 17:46:21 |
|
|
133
|
+
| `isoDateTime` | `yyyy-mm-dd'T'HH:MM:sso` | 2007-06-09T17:46:21+0700 |
|
|
134
|
+
| `isoUtcDateTime` | `UTC:yyyy-mm-dd'T'HH:MM:ss'Z'` | 2007-06-09T22:46:21Z |
|
|
135
|
+
|
|
136
|
+
### Localization
|
|
137
|
+
|
|
138
|
+
Day names, month names and the AM/PM indicators can be localized by
|
|
139
|
+
passing an object with the necessary strings. For example:
|
|
140
|
+
|
|
141
|
+
```js
|
|
142
|
+
var dateFormat = require("dateformat");
|
|
143
|
+
dateFormat.i18n = {
|
|
144
|
+
dayNames: [
|
|
145
|
+
"Sun",
|
|
146
|
+
"Mon",
|
|
147
|
+
"Tue",
|
|
148
|
+
"Wed",
|
|
149
|
+
"Thu",
|
|
150
|
+
"Fri",
|
|
151
|
+
"Sat",
|
|
152
|
+
"Sunday",
|
|
153
|
+
"Monday",
|
|
154
|
+
"Tuesday",
|
|
155
|
+
"Wednesday",
|
|
156
|
+
"Thursday",
|
|
157
|
+
"Friday",
|
|
158
|
+
"Saturday",
|
|
159
|
+
],
|
|
160
|
+
monthNames: [
|
|
161
|
+
"Jan",
|
|
162
|
+
"Feb",
|
|
163
|
+
"Mar",
|
|
164
|
+
"Apr",
|
|
165
|
+
"May",
|
|
166
|
+
"Jun",
|
|
167
|
+
"Jul",
|
|
168
|
+
"Aug",
|
|
169
|
+
"Sep",
|
|
170
|
+
"Oct",
|
|
171
|
+
"Nov",
|
|
172
|
+
"Dec",
|
|
173
|
+
"January",
|
|
174
|
+
"February",
|
|
175
|
+
"March",
|
|
176
|
+
"April",
|
|
177
|
+
"May",
|
|
178
|
+
"June",
|
|
179
|
+
"July",
|
|
180
|
+
"August",
|
|
181
|
+
"September",
|
|
182
|
+
"October",
|
|
183
|
+
"November",
|
|
184
|
+
"December",
|
|
185
|
+
],
|
|
186
|
+
timeNames: ["a", "p", "am", "pm", "A", "P", "AM", "PM"],
|
|
187
|
+
};
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
> Notice that only one language is supported at a time and all strings
|
|
191
|
+
> _must_ be present in the new value.
|
|
192
|
+
|
|
193
|
+
### Breaking change in 2.1.0
|
|
194
|
+
|
|
195
|
+
- 2.1.0 was published with a breaking change, for those using localized strings.
|
|
196
|
+
- 2.2.0 has been published without the change, to keep packages refering to ^2.0.0 to continue working. This is now branch v2_2.
|
|
197
|
+
- 3.0.\* contains the localized AM/PM change.
|
|
198
|
+
|
|
199
|
+
## License
|
|
200
|
+
|
|
201
|
+
(c) 2007-2009 Steven Levithan [stevenlevithan.com][stevenlevithan], MIT license.
|
|
202
|
+
|
|
203
|
+
[dateformat]: http://blog.stevenlevithan.com/archives/date-time-format
|
|
204
|
+
[stevenlevithan]: http://stevenlevithan.com/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function _typeof(obj){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){_typeof=function _typeof(obj){return typeof obj}}else{_typeof=function _typeof(obj){return obj&&typeof Symbol==="function"&&obj.constructor===Symbol&&obj!==Symbol.prototype?"symbol":typeof obj}}return _typeof(obj)}(function(global){var _arguments=arguments;var dateFormat=function(){var token=/d{1,4}|D{3,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|W{1,2}|[LlopSZN]|"[^"]*"|'[^']*'/g;var timezone=/\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g;var timezoneClip=/[^-+\dA-Z]/g;return function(date,mask,utc,gmt){if(_arguments.length===1&&kindOf(date)==="string"&&!/\d/.test(date)){mask=date;date=undefined}date=date||date===0?date:new Date;if(!(date instanceof Date)){date=new Date(date)}if(isNaN(date)){throw TypeError("Invalid date")}mask=String(dateFormat.masks[mask]||mask||dateFormat.masks["default"]);var maskSlice=mask.slice(0,4);if(maskSlice==="UTC:"||maskSlice==="GMT:"){mask=mask.slice(4);utc=true;if(maskSlice==="GMT:"){gmt=true}}var _=function _(){return utc?"getUTC":"get"};var _d=function d(){return date[_()+"Date"]()};var D=function D(){return date[_()+"Day"]()};var _m=function m(){return date[_()+"Month"]()};var y=function y(){return date[_()+"FullYear"]()};var _H=function H(){return date[_()+"Hours"]()};var _M=function M(){return date[_()+"Minutes"]()};var _s=function s(){return date[_()+"Seconds"]()};var _L=function L(){return date[_()+"Milliseconds"]()};var _o=function o(){return utc?0:date.getTimezoneOffset()};var _W=function W(){return getWeek(date)};var _N=function N(){return getDayOfWeek(date)};var flags={d:function d(){return _d()},dd:function dd(){return pad(_d())},ddd:function ddd(){return dateFormat.i18n.dayNames[D()]},DDD:function DDD(){return getDayName({y:y(),m:_m(),d:_d(),_:_(),dayName:dateFormat.i18n.dayNames[D()],short:true})},dddd:function dddd(){return dateFormat.i18n.dayNames[D()+7]},DDDD:function DDDD(){return getDayName({y:y(),m:_m(),d:_d(),_:_(),dayName:dateFormat.i18n.dayNames[D()+7]})},m:function m(){return _m()+1},mm:function mm(){return pad(_m()+1)},mmm:function mmm(){return dateFormat.i18n.monthNames[_m()]},mmmm:function mmmm(){return dateFormat.i18n.monthNames[_m()+12]},yy:function yy(){return String(y()).slice(2)},yyyy:function yyyy(){return pad(y(),4)},h:function h(){return _H()%12||12},hh:function hh(){return pad(_H()%12||12)},H:function H(){return _H()},HH:function HH(){return pad(_H())},M:function M(){return _M()},MM:function MM(){return pad(_M())},s:function s(){return _s()},ss:function ss(){return pad(_s())},l:function l(){return pad(_L(),3)},L:function L(){return pad(Math.floor(_L()/10))},t:function t(){return _H()<12?dateFormat.i18n.timeNames[0]:dateFormat.i18n.timeNames[1]},tt:function tt(){return _H()<12?dateFormat.i18n.timeNames[2]:dateFormat.i18n.timeNames[3]},T:function T(){return _H()<12?dateFormat.i18n.timeNames[4]:dateFormat.i18n.timeNames[5]},TT:function TT(){return _H()<12?dateFormat.i18n.timeNames[6]:dateFormat.i18n.timeNames[7]},Z:function Z(){return gmt?"GMT":utc?"UTC":(String(date).match(timezone)||[""]).pop().replace(timezoneClip,"").replace(/GMT\+0000/g,"UTC")},o:function o(){return(_o()>0?"-":"+")+pad(Math.floor(Math.abs(_o())/60)*100+Math.abs(_o())%60,4)},p:function p(){return(_o()>0?"-":"+")+pad(Math.floor(Math.abs(_o())/60),2)+":"+pad(Math.floor(Math.abs(_o())%60),2)},S:function S(){return["th","st","nd","rd"][_d()%10>3?0:(_d()%100-_d()%10!=10)*_d()%10]},W:function W(){return _W()},WW:function WW(){return pad(_W())},N:function N(){return _N()}};return mask.replace(token,function(match){if(match in flags){return flags[match]()}return match.slice(1,match.length-1)})}}();dateFormat.masks={default:"ddd mmm dd yyyy HH:MM:ss",shortDate:"m/d/yy",paddedShortDate:"mm/dd/yyyy",mediumDate:"mmm d, yyyy",longDate:"mmmm d, yyyy",fullDate:"dddd, mmmm d, yyyy",shortTime:"h:MM TT",mediumTime:"h:MM:ss TT",longTime:"h:MM:ss TT Z",isoDate:"yyyy-mm-dd",isoTime:"HH:MM:ss",isoDateTime:"yyyy-mm-dd'T'HH:MM:sso",isoUtcDateTime:"UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",expiresHeaderFormat:"ddd, dd mmm yyyy HH:MM:ss Z"};dateFormat.i18n={dayNames:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],monthNames:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec","January","February","March","April","May","June","July","August","September","October","November","December"],timeNames:["a","p","am","pm","A","P","AM","PM"]};var pad=function pad(val,len){val=String(val);len=len||2;while(val.length<len){val="0"+val}return val};var getDayName=function getDayName(_ref){var y=_ref.y,m=_ref.m,d=_ref.d,_=_ref._,dayName=_ref.dayName,_ref$short=_ref["short"],_short=_ref$short===void 0?false:_ref$short;var today=new Date;var yesterday=new Date;yesterday.setDate(yesterday[_+"Date"]()-1);var tomorrow=new Date;tomorrow.setDate(tomorrow[_+"Date"]()+1);var today_d=function today_d(){return today[_+"Date"]()};var today_m=function today_m(){return today[_+"Month"]()};var today_y=function today_y(){return today[_+"FullYear"]()};var yesterday_d=function yesterday_d(){return yesterday[_+"Date"]()};var yesterday_m=function yesterday_m(){return yesterday[_+"Month"]()};var yesterday_y=function yesterday_y(){return yesterday[_+"FullYear"]()};var tomorrow_d=function tomorrow_d(){return tomorrow[_+"Date"]()};var tomorrow_m=function tomorrow_m(){return tomorrow[_+"Month"]()};var tomorrow_y=function tomorrow_y(){return tomorrow[_+"FullYear"]()};if(today_y()===y&&today_m()===m&&today_d()===d){return _short?"Tdy":"Today"}else if(yesterday_y()===y&&yesterday_m()===m&&yesterday_d()===d){return _short?"Ysd":"Yesterday"}else if(tomorrow_y()===y&&tomorrow_m()===m&&tomorrow_d()===d){return _short?"Tmw":"Tomorrow"}return dayName};var getWeek=function getWeek(date){var targetThursday=new Date(date.getFullYear(),date.getMonth(),date.getDate());targetThursday.setDate(targetThursday.getDate()-(targetThursday.getDay()+6)%7+3);var firstThursday=new Date(targetThursday.getFullYear(),0,4);firstThursday.setDate(firstThursday.getDate()-(firstThursday.getDay()+6)%7+3);var ds=targetThursday.getTimezoneOffset()-firstThursday.getTimezoneOffset();targetThursday.setHours(targetThursday.getHours()-ds);var weekDiff=(targetThursday-firstThursday)/(864e5*7);return 1+Math.floor(weekDiff)};var getDayOfWeek=function getDayOfWeek(date){var dow=date.getDay();if(dow===0){dow=7}return dow};var kindOf=function kindOf(val){if(val===null){return"null"}if(val===undefined){return"undefined"}if(_typeof(val)!=="object"){return _typeof(val)}if(Array.isArray(val)){return"array"}return{}.toString.call(val).slice(8,-1).toLowerCase()};if(typeof define==="function"&&define.amd){define(function(){return dateFormat})}else if((typeof exports==="undefined"?"undefined":_typeof(exports))==="object"){module.exports=dateFormat}else{global.dateFormat=dateFormat}})(void 0);
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dateformat",
|
|
3
|
+
"description": "A node.js package for Steven Levithan's excellent dateFormat() function.",
|
|
4
|
+
"maintainers": [
|
|
5
|
+
"Felix Geisendörfer <felix@debuggable.com>"
|
|
6
|
+
],
|
|
7
|
+
"homepage": "https://github.com/felixge/node-dateformat",
|
|
8
|
+
"author": "Steven Levithan",
|
|
9
|
+
"contributors": [
|
|
10
|
+
"Steven Levithan",
|
|
11
|
+
"Felix Geisendörfer <felix@debuggable.com>",
|
|
12
|
+
"Christoph Tavan <dev@tavan.de>",
|
|
13
|
+
"Jon Schlinkert (https://github.com/jonschlinkert)"
|
|
14
|
+
],
|
|
15
|
+
"version": "4.5.1",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"main": "lib/dateformat",
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@babel/cli": "^7.12.10",
|
|
20
|
+
"@babel/core": "^7.12.10",
|
|
21
|
+
"@babel/preset-env": "^7.12.11",
|
|
22
|
+
"mocha": "^8.2.1",
|
|
23
|
+
"uglify-js": "^3.12.5"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": "*"
|
|
27
|
+
},
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build": "./node_modules/.bin/babel src --out-dir lib && uglifyjs lib/dateformat.js -o lib/dateformat.js",
|
|
30
|
+
"test": "npm run build && mocha",
|
|
31
|
+
"benchmark": "npm run build && node ./benchmark/benchmark.js"
|
|
32
|
+
},
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/felixge/node-dateformat.git"
|
|
36
|
+
},
|
|
37
|
+
"dependencies": {}
|
|
38
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changers Lorgs!
|
|
2
|
+
|
|
3
|
+
## 1.0
|
|
4
|
+
|
|
5
|
+
Full rewrite. Essentially a brand new module.
|
|
6
|
+
|
|
7
|
+
- Return a promise instead of taking a callback.
|
|
8
|
+
- Use native `fs.mkdir(path, { recursive: true })` when available.
|
|
9
|
+
- Drop support for outdated Node.js versions. (Technically still works on
|
|
10
|
+
Node.js v8, but only 10 and above are officially supported.)
|
|
11
|
+
|
|
12
|
+
## 0.x
|
|
13
|
+
|
|
14
|
+
Original and most widely used recursive directory creation implementation
|
|
15
|
+
in JavaScript, dating back to 2010.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
Copyright James Halliday (mail@substack.net) and Isaac Z. Schlueter (i@izs.me)
|
|
2
|
+
|
|
3
|
+
This project is free software released under the MIT license:
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
|
13
|
+
all copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
21
|
+
THE SOFTWARE.
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const usage = () => `
|
|
4
|
+
usage: mkdirp [DIR1,DIR2..] {OPTIONS}
|
|
5
|
+
|
|
6
|
+
Create each supplied directory including any necessary parent directories
|
|
7
|
+
that don't yet exist.
|
|
8
|
+
|
|
9
|
+
If the directory already exists, do nothing.
|
|
10
|
+
|
|
11
|
+
OPTIONS are:
|
|
12
|
+
|
|
13
|
+
-m<mode> If a directory needs to be created, set the mode as an octal
|
|
14
|
+
--mode=<mode> permission string.
|
|
15
|
+
|
|
16
|
+
-v --version Print the mkdirp version number
|
|
17
|
+
|
|
18
|
+
-h --help Print this helpful banner
|
|
19
|
+
|
|
20
|
+
-p --print Print the first directories created for each path provided
|
|
21
|
+
|
|
22
|
+
--manual Use manual implementation, even if native is available
|
|
23
|
+
`
|
|
24
|
+
|
|
25
|
+
const dirs = []
|
|
26
|
+
const opts = {}
|
|
27
|
+
let print = false
|
|
28
|
+
let dashdash = false
|
|
29
|
+
let manual = false
|
|
30
|
+
for (const arg of process.argv.slice(2)) {
|
|
31
|
+
if (dashdash)
|
|
32
|
+
dirs.push(arg)
|
|
33
|
+
else if (arg === '--')
|
|
34
|
+
dashdash = true
|
|
35
|
+
else if (arg === '--manual')
|
|
36
|
+
manual = true
|
|
37
|
+
else if (/^-h/.test(arg) || /^--help/.test(arg)) {
|
|
38
|
+
console.log(usage())
|
|
39
|
+
process.exit(0)
|
|
40
|
+
} else if (arg === '-v' || arg === '--version') {
|
|
41
|
+
console.log(require('../package.json').version)
|
|
42
|
+
process.exit(0)
|
|
43
|
+
} else if (arg === '-p' || arg === '--print') {
|
|
44
|
+
print = true
|
|
45
|
+
} else if (/^-m/.test(arg) || /^--mode=/.test(arg)) {
|
|
46
|
+
const mode = parseInt(arg.replace(/^(-m|--mode=)/, ''), 8)
|
|
47
|
+
if (isNaN(mode)) {
|
|
48
|
+
console.error(`invalid mode argument: ${arg}\nMust be an octal number.`)
|
|
49
|
+
process.exit(1)
|
|
50
|
+
}
|
|
51
|
+
opts.mode = mode
|
|
52
|
+
} else
|
|
53
|
+
dirs.push(arg)
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const mkdirp = require('../')
|
|
57
|
+
const impl = manual ? mkdirp.manual : mkdirp
|
|
58
|
+
if (dirs.length === 0)
|
|
59
|
+
console.error(usage())
|
|
60
|
+
|
|
61
|
+
Promise.all(dirs.map(dir => impl(dir, opts)))
|
|
62
|
+
.then(made => print ? made.forEach(m => m && console.log(m)) : null)
|
|
63
|
+
.catch(er => {
|
|
64
|
+
console.error(er.message)
|
|
65
|
+
if (er.code)
|
|
66
|
+
console.error(' code: ' + er.code)
|
|
67
|
+
process.exit(1)
|
|
68
|
+
})
|