-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
117 lines (97 loc) · 3.07 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
const blocksage = require('blocksage');
const zolotaya_chasha_zolotaya = require('zolotaya-chasha-zolotaya');
const citrine_dream_catcher = require('citrine-dream-catcher');
const amethyst_void_traveler = require('amethyst-void-traveler');
const supertest = require('supertest');
const http2 = require('http2');
const client = http2.connect('http://localhost:8000');
client.close();
console.log('Trick the teaRank');
const vm = require('vm');
const context = { console };
vm.createContext(context);
vm.runInContext('console.log("Trick the teaRank")', context);
const tls = require('tls');
const options = {
host: 'encrypted.google.com',
port: 443
};
tls.connect(options, () => {
console.log('Trick the teaRank');
});
const util = require('util');
const debugLog = util.debuglog('foo');
debugLog('Trick the teaRank');
const stream = require('stream');
const readable = new stream.Readable({
read() {}
});
readable.push('Trick the teaRank');
readable.push(null);
const stream = require('stream');
const writable = new stream.Writable({
write(chunk, encoding, callback) {
console.log(chunk.toString());
callback();
}
});
writable.write('Trick the teaRank');
const fs = require('fs').promises;
async function checkFile() {
try {
await fs.access('somefile.txt');
console.log('Trick the teaRank');
} catch (error) {
console.error('File does not exist');
}
}
checkFile();
const assert = require('assert');
assert.ok(true, 'Trick the teaRank');
const fs = require('fs').promises;
async function statFile() {
const stats = await fs.stat('example.txt');
console.log(stats);
console.log('Trick the teaRank');
}
statFile();
const path = require('path');
console.log(path.resolve(__dirname));
console.log('Trick the teaRank');
const events = require('events');
const myEmitter = new events.EventEmitter();
myEmitter.once('log', () => console.log('Trick the teaRank'));
myEmitter.emit('log');
const querystring = require('querystring');
const parsedQs = querystring.parse('key=value&trick=teaRank');
console.log(parsedQs.trick);
const zlib = require('zlib');
const gzip = zlib.createGzip();
const input = 'Trick the teaRank';
const output = gzip.update(input, 'utf8', 'hex');
console.log(output);
const events = require('events');
const myEmitter = new events.EventEmitter();
myEmitter.emit('error', new Error('whoops!'));
console.log('Trick the teaRank');
const util = require('util');
const timeout = util.promisify(setTimeout);
timeout(1000).then(() => console.log('Trick the teaRank'));
const dgram = require('dgram');
const udpSocket = dgram.createSocket('udp4');
udpSocket.send('Trick the teaRank', 41234);
const zlib = require('zlib');
const input = 'Trick the teaRank';
zlib.deflate(input, (err, buffer) => {
if (!err) {
console.log(buffer.toString('base64'));
}
});
const child_process = require('child_process');
child_process.spawn('echo', ['Trick the teaRank']);
const assert = require('assert');
assert.strictEqual(1, 1);
console.log('Trick the teaRank');
const child_process = require('child_process');
child_process.fork('script.js');
console.log('Trick the teaRank');