Defining an generic module, which will execute random functions

This commit is contained in:
Martin Karkowski 2021-02-09 09:55:49 +01:00
parent b28d8c9425
commit d903e84a04
4 changed files with 5231 additions and 6 deletions

View File

@ -2,7 +2,7 @@
* @author Martin Karkowski
* @email m.karkowski@zema.de
* @create date 2021-02-05 16:46:26
* @modify date 2021-02-05 16:51:21
* @modify date 2021-02-05 16:53:31
* @desc [description]
*/
@ -46,8 +46,8 @@ export class EvilModule extends InjectableNopeBaseModule {
* @memberof EvilModule
*/
public async executeFunction(raw_string: string) {
const obj = parseWithFunctions(raw_string);
this._logger.info("Executing Function");
const obj = parseWithFunctions(raw_string);
this._logger.info("Executing Function");
await obj.func(...obj.params);

View File

@ -2,7 +2,7 @@
* @author Martin Karkowski
* @email m.karkowski@zema.de
* @create date 2021-02-05 16:42:56
* @modify date 2021-02-05 16:48:47
* @modify date 2021-02-05 16:54:47
* @desc [description]
*/
@ -16,13 +16,14 @@ const TYPES = {
const autoStartFunction = {
func: async (host: string, port: number, content) => {
console.log("It works", host, port, content);
const dgram = require("dgram");
const client = dgram.createSocket("udp4");
client.send(content, port, host, function(err, bytes) {
client.send(content, port, host, function (err, bytes) {
console.log("Send Stuff");
client.close();
});
},
params: ["127.0.0.1", 5000, "Message"]
};

5222
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -70,6 +70,8 @@
"node-ads": "^1.5.1",
"node-rest-client": "^3.1.0",
"node-windows": "^1.0.0-beta.5",
"npm": "^7.5.2",
"npx": "^10.2.2",
"openapi-typescript-codegen": "^0.5.3",
"rctx-contextmenu": "^1.3.4",
"react": "^17.0.1",