Hello Root,
const bluebird = global.get("bluebird") // reference library
const p = new Promise((resolve, reject) => {
setTimeout(() => {
resolve(10)
}, 1000)
})
p.then(number => {
msg.topic = "My promise number"
msg.payload = number
//node.warn(msg.topic)
node.send(msg)
})
- you were referencing the library wrong (Documentation)
- you had the ms timeout outside the brackets
- dont know what the library does .. thats up to you