console-chaos-engine 1.0.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/LICENSE +7 -0
- package/README.md +137 -0
- package/chaos.js +48 -0
- package/cli.js +14 -0
- package/console-chaos-engine-1.0.0.tgz +0 -0
- package/ex.js +45 -0
- package/index.js +102 -0
- package/package.json +13 -0
- package/types.d.ts +9 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
Copyright 2026 Tonie C.
|
|
2
|
+
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
4
|
+
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
6
|
+
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# console-chaos-engine
|
|
2
|
+
|
|
3
|
+
A chaotic Node.js package that intentionally corrupts and disrupts console output for fun, testing, or pure evil.
|
|
4
|
+
Made by Tonie → https://toniec.github.io
|
|
5
|
+
|
|
6
|
+
NPM Download → https://www.npmjs.com/package/console-chaos-engine
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```bash
|
|
13
|
+
npm install console-chaos-engine
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
## Basic Usage
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
const chaos = require("console-chaos-engine");
|
|
22
|
+
|
|
23
|
+
chaos.enable();
|
|
24
|
+
|
|
25
|
+
console.log("Hello world");
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
## Advanced Usage
|
|
31
|
+
|
|
32
|
+
```js
|
|
33
|
+
const chaos = require("console-chaos-engine");
|
|
34
|
+
|
|
35
|
+
chaos.enable({
|
|
36
|
+
level: 0.6,
|
|
37
|
+
reverse: true,
|
|
38
|
+
dropRate: 0.2,
|
|
39
|
+
duplicateRate: 0.4
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
console.log("This will be ruined");
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Disable Chaos
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
chaos.disable();
|
|
51
|
+
|
|
52
|
+
console.log("Back to normal");
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
---
|
|
56
|
+
|
|
57
|
+
## CLI Usage
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
npx chaos
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## What it does
|
|
66
|
+
|
|
67
|
+
* Scrambles text randomly
|
|
68
|
+
* Injects glitch (zalgo) characters
|
|
69
|
+
* Reverses output
|
|
70
|
+
* Adds random colors
|
|
71
|
+
* Drops logs entirely
|
|
72
|
+
* Duplicates messages
|
|
73
|
+
* Injects fake system messages
|
|
74
|
+
* Generates fake errors and stack traces
|
|
75
|
+
* Delays logs and reorders them
|
|
76
|
+
* Gradually increases chaos over time
|
|
77
|
+
|
|
78
|
+
---
|
|
79
|
+
|
|
80
|
+
## Options
|
|
81
|
+
|
|
82
|
+
| Option | Type | Description |
|
|
83
|
+
| ------------- | ------- | --------------------------- |
|
|
84
|
+
| level | number | Chaos intensity (0.0 - 1.0) |
|
|
85
|
+
| reverse | boolean | Reverse output text |
|
|
86
|
+
| dropRate | number | Chance to remove logs |
|
|
87
|
+
| duplicateRate | number | Chance to duplicate logs |
|
|
88
|
+
|
|
89
|
+
---
|
|
90
|
+
|
|
91
|
+
## Example Output
|
|
92
|
+
|
|
93
|
+
```
|
|
94
|
+
Error: H̴e̷l̷l̶o̴ ̵w̶o̴r̶l̷d̴
|
|
95
|
+
at chaos (132:42)
|
|
96
|
+
|
|
97
|
+
[SYSTEM] Unknown operation completed.
|
|
98
|
+
|
|
99
|
+
dlr%w olleH (duplicate)
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
## Requirements
|
|
105
|
+
|
|
106
|
+
* Node.js environment
|
|
107
|
+
* Console access
|
|
108
|
+
* Strong mental stability
|
|
109
|
+
|
|
110
|
+
---
|
|
111
|
+
|
|
112
|
+
## Notes
|
|
113
|
+
|
|
114
|
+
* Overrides `console.log`, `console.warn`, and `console.error`
|
|
115
|
+
* Does NOT restore automatically (use `disable()`)
|
|
116
|
+
* Designed for testing, trolling, or chaos experiments
|
|
117
|
+
* Not recommended for real production use
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
## Contributing
|
|
122
|
+
|
|
123
|
+
Pull requests are welcome.
|
|
124
|
+
Ideas: more chaos modes, plugins, browser support, stealth activation.
|
|
125
|
+
|
|
126
|
+
---
|
|
127
|
+
|
|
128
|
+
## License
|
|
129
|
+
|
|
130
|
+
MIT
|
|
131
|
+
|
|
132
|
+
---
|
|
133
|
+
|
|
134
|
+
## Warning
|
|
135
|
+
|
|
136
|
+
This package will destroy your logs.
|
|
137
|
+
Use responsibly… or don’t.
|
package/chaos.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
const weird = ["@", "#", "$", "%", "&", "*", "?", "!", "~"];
|
|
2
|
+
const zalgoMarks = [
|
|
3
|
+
"\u0300","\u0301","\u0302","\u0303","\u0304","\u0305"
|
|
4
|
+
];
|
|
5
|
+
|
|
6
|
+
const colors = [
|
|
7
|
+
"\x1b[31m","\x1b[32m","\x1b[33m",
|
|
8
|
+
"\x1b[34m","\x1b[35m","\x1b[36m"
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const reset = "\x1b[0m";
|
|
12
|
+
|
|
13
|
+
const rand = (min, max) => Math.random() * (max - min) + min;
|
|
14
|
+
const pick = arr => arr[Math.floor(Math.random() * arr.length)];
|
|
15
|
+
|
|
16
|
+
function scramble(str, intensity) {
|
|
17
|
+
return str.split("").map(c =>
|
|
18
|
+
Math.random() < intensity ? pick(weird) : c
|
|
19
|
+
).join("");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function zalgo(str, intensity) {
|
|
23
|
+
return str.split("").map(c => {
|
|
24
|
+
if (Math.random() < intensity) {
|
|
25
|
+
return c + pick(zalgoMarks);
|
|
26
|
+
}
|
|
27
|
+
return c;
|
|
28
|
+
}).join("");
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function reverse(str, enabled) {
|
|
32
|
+
return enabled ? str.split("").reverse().join("") : str;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function fakeError(msg) {
|
|
36
|
+
return `Error: ${msg}\n at chaos (${Math.floor(rand(1,200))}:${Math.floor(rand(1,80))})`;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
module.exports = {
|
|
40
|
+
scramble,
|
|
41
|
+
zalgo,
|
|
42
|
+
reverse,
|
|
43
|
+
fakeError,
|
|
44
|
+
colors,
|
|
45
|
+
reset,
|
|
46
|
+
rand,
|
|
47
|
+
pick
|
|
48
|
+
};
|
package/cli.js
ADDED
|
Binary file
|
package/ex.js
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
const chaos = require("./index"); // or "console-chaos-engine" if installed
|
|
2
|
+
|
|
3
|
+
// enable MAX chaos
|
|
4
|
+
chaos.enable({
|
|
5
|
+
level: 0.6,
|
|
6
|
+
reverse: true,
|
|
7
|
+
dropRate: 0.2,
|
|
8
|
+
duplicateRate: 0.4
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
let i = 0;
|
|
12
|
+
|
|
13
|
+
// spam logs
|
|
14
|
+
const spam = setInterval(() => {
|
|
15
|
+
console.log("Log message", i);
|
|
16
|
+
console.warn("Warning at", i);
|
|
17
|
+
console.error("Error at", i);
|
|
18
|
+
|
|
19
|
+
i++;
|
|
20
|
+
|
|
21
|
+
if (i > 30) {
|
|
22
|
+
clearInterval(spam);
|
|
23
|
+
|
|
24
|
+
setTimeout(() => {
|
|
25
|
+
chaos.disable();
|
|
26
|
+
console.log("=== console restored ===");
|
|
27
|
+
}, 3000);
|
|
28
|
+
}
|
|
29
|
+
}, 100);
|
|
30
|
+
|
|
31
|
+
// extra chaos: async logs
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
console.log("Async operation complete");
|
|
34
|
+
}, 1500);
|
|
35
|
+
|
|
36
|
+
setTimeout(() => {
|
|
37
|
+
console.error("Database connection lost");
|
|
38
|
+
}, 2200);
|
|
39
|
+
|
|
40
|
+
// even more chaos: burst logs
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
for (let j = 0; j < 10; j++) {
|
|
43
|
+
console.log("Burst log", j);
|
|
44
|
+
}
|
|
45
|
+
}, 1800);
|
package/index.js
ADDED
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const {
|
|
2
|
+
scramble,
|
|
3
|
+
zalgo,
|
|
4
|
+
reverse,
|
|
5
|
+
fakeError,
|
|
6
|
+
colors,
|
|
7
|
+
reset,
|
|
8
|
+
rand,
|
|
9
|
+
pick
|
|
10
|
+
} = require("./chaos");
|
|
11
|
+
|
|
12
|
+
let config = {
|
|
13
|
+
level: 0.3,
|
|
14
|
+
reverse: false,
|
|
15
|
+
dropRate: 0.1,
|
|
16
|
+
duplicateRate: 0.2
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
let enabled = false;
|
|
20
|
+
let original = {};
|
|
21
|
+
let queue = [];
|
|
22
|
+
let flushing = false;
|
|
23
|
+
|
|
24
|
+
function flushQueue() {
|
|
25
|
+
if (flushing) return;
|
|
26
|
+
flushing = true;
|
|
27
|
+
|
|
28
|
+
(async () => {
|
|
29
|
+
while (queue.length) {
|
|
30
|
+
const msg = queue.shift();
|
|
31
|
+
await new Promise(r => setTimeout(r, rand(10, 200)));
|
|
32
|
+
process.stdout.write(msg + "\n");
|
|
33
|
+
}
|
|
34
|
+
flushing = false;
|
|
35
|
+
})();
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function chaosOutput(args) {
|
|
39
|
+
if (Math.random() < config.dropRate) return;
|
|
40
|
+
|
|
41
|
+
let msg = args.join(" ");
|
|
42
|
+
|
|
43
|
+
if (Math.random() < config.level) msg = scramble(msg, config.level);
|
|
44
|
+
if (Math.random() < config.level) msg = zalgo(msg, config.level);
|
|
45
|
+
if (Math.random() < config.level * 0.5) msg = reverse(msg, config.reverse);
|
|
46
|
+
|
|
47
|
+
if (Math.random() < config.level * 0.4) {
|
|
48
|
+
msg = fakeError(msg);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
if (Math.random() < 0.8) {
|
|
52
|
+
msg = pick(colors) + msg + reset;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
queue.push(msg);
|
|
56
|
+
|
|
57
|
+
if (Math.random() < config.duplicateRate) {
|
|
58
|
+
queue.push(msg + " (duplicate)");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
if (Math.random() < config.level * 0.3) {
|
|
62
|
+
queue.push("[SYSTEM] Unknown operation completed.");
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
flushQueue();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function enable(userConfig = {}) {
|
|
69
|
+
if (enabled) return;
|
|
70
|
+
|
|
71
|
+
config = { ...config, ...userConfig };
|
|
72
|
+
|
|
73
|
+
original.log = console.log;
|
|
74
|
+
original.warn = console.warn;
|
|
75
|
+
original.error = console.error;
|
|
76
|
+
|
|
77
|
+
console.log = (...args) => chaosOutput(args);
|
|
78
|
+
console.warn = (...args) => chaosOutput(args);
|
|
79
|
+
console.error = (...args) => chaosOutput(args);
|
|
80
|
+
|
|
81
|
+
enabled = true;
|
|
82
|
+
|
|
83
|
+
// escalation over time
|
|
84
|
+
setInterval(() => {
|
|
85
|
+
config.level = Math.min(1, config.level + 0.05);
|
|
86
|
+
}, 3000);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function disable() {
|
|
90
|
+
if (!enabled) return;
|
|
91
|
+
|
|
92
|
+
console.log = original.log;
|
|
93
|
+
console.warn = original.warn;
|
|
94
|
+
console.error = original.error;
|
|
95
|
+
|
|
96
|
+
enabled = false;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
module.exports = {
|
|
100
|
+
enable,
|
|
101
|
+
disable
|
|
102
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "console-chaos-engine",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "An extremely chaotic console logger for Node.js",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"chaos": "./cli.js"
|
|
8
|
+
},
|
|
9
|
+
"types": "types.d.ts",
|
|
10
|
+
"keywords": ["console", "chaos", "logger", "fun"],
|
|
11
|
+
"author": "Tonie",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|