I need that users scripts run with a trigger, i.e. when a collection is saved/deleted there can be 2 scripts that runs, one before and one after, also will be cool to limit the time that the scripts runs maybe a burst limit of 15 o 30 seconds, so we prevent that users consume so much resources, I don't want to limit loops or conditions, only that user require modules outside their environment and example of what I want to accomplish in similar to
Parse Cloud Functions, basically it gave you a structure that you need to follow, like a folder where you have 2 folders one with the data of your app (id and secret keys) and other with your code, where you can require modules inside this folder. but also it have limited functionality, seems that some nodejs functions was override or something similar.
This is not my area so I'm lost of how to start investigating this kind of things, because seems that is required a lot of server management and also touch in some way nodejs (maybe its possible to override nodejs in realtime or for certain child proceses).
Regards