3 ms·
Oh, dude! Genius. I needed something exactly like this. Is there a similar lightweight approach in node land? Edit: my usecase is a form builder where users ca
by xmonkee 4y ago
Oh, dude! Genius. I needed something exactly like this.
Is there a similar lightweight approach in node land?
Edit: my usecase is a form builder where users can specify fields that have their values computed from other fields. I've had to hobble it by using templating languages for the custom code, or just let them use javascript and be okay with the risk since the users get their own subdomain, so it's kinda like their own website.
- turblety 4y agoThere is vm2 [0] for nodejs, but if you look at the issues there are escapes found occasionally, even some this year. I think it's too risky to run untrusted code on node. You could run a headless chrome using puppeteer, then run workerbox. But it's probably too much overhead for a server app. Oh, if you're making a form builder, I have to recommend json-editor [1]. It's not mine and I haven't actually used it just (I've only found really recently), but basically you give a JSONSchema and it will make a form for you, with validations and conditionals all built in. Might come in useful. 0. https://github.com/markwylde/vm2-process https://github.com/markwylde/vm2-process 1. https://github.com/jdorn/json-editor https://github.com/jdorn/json-editor