Globally registers an async function name to trigger automatic addition of the await keyword when the function is used. This API can be used during server startup to load and register globally shared function names.
Parameters
- (String) Function name
Example
Code Block | ||
---|---|---|
| ||
if (!global.mycompany) global.mycompany = {}; if (!mycompany.utils) mycompany.utils = {}; mycompany.utils.usefulFunction = pjs.require("utils/usefulFunction.js"); pjs.registerAsyncName("mycompany.utils.usefulFunction"); |