const Promise = context.global.bluebird
const p = new Promise((resolve, reject) => {
setTimeout(()=>{
resolve(10)
}),1000
})
p.then(number => {
msg.topic = number
node.warn(msg.topic)
return msg
})
and can't return the msg object. In addition, I still did not understand how to properly connect external modules through the setup tab of the function block.
Do not use bluebird. There is no good reason for using that library these days. All supported versions of node.js have full support for Promise built in.
I'm just studying the tool I'm trying to work with. I am reading this wonderful forum and I am asking questions that are incomprehensible to me. But first, in order not to distract the community, I try to figure it out on my own. I think many people do this. Although the above example was simple, it still allowed me to go further. Thank you sincerely for your wonderful knowledge.