added unpack & moved build stuff

This commit is contained in:
2024-04-16 11:05:28 +02:00
parent baae1428bd
commit adb758bd53
7 changed files with 73 additions and 18 deletions

32
tools/console.js Normal file
View File

@@ -0,0 +1,32 @@
const http = require('http');
function time() {
let now = new Date();
return `${now.getHours().toString().padStart(2, "0")}:${now.getMinutes().toString().padStart(2, 0)}:${now.getSeconds().toString().padStart(2, 0)}`;
}
const server = http.createServer((req, res) => {
if (req.method != "POST") {
res.writeHead(400);
return;
}
var id = req.url.substring(1);
let data = "";
req.on('data', chunk => {
data += chunk;
})
req.on('end', () => {
console.log(`[${time()}][${id}]${data}`);
res.writeHead(200);
res.end();
})
});
console.log("Listening on port 8080")
server.listen(8080);

8
tools/minify.js Normal file
View File

@@ -0,0 +1,8 @@
const fs = require("fs");
const luamin = require("luamin");
const haxeOutput = fs.readFileSync(0, { encoding: "utf8" });
const minified = luamin.minify(haxeOutput);
fs.writeFileSync(1, minified);

5
tools/zlibDeflate.js Normal file
View File

@@ -0,0 +1,5 @@
const zlib = require('node:zlib');
let def = zlib.createDeflate();
process.stdin.pipe(def).pipe(process.stdout);