Setup and close of new function node: Discussion about use cases/extensions

(it was no critique in any way, I think it is totally sensible to start with a bare minimum, I just wanted to start a discussion for possible extensions)

I have read the design note and it is good idea to more easily add npm dependencies.

If I would summarize my requirements:

  • expose send, done in the setup handler (when done is called, resolve the promise)
  • expose status, log, warn, error (maybe also id, name etc.) both in setup and closing handler
  • make closing handler optionally async by exposing done.

This would make the function node quite equivalent to a custom node (ignoring the ui).

I guess this would then allow to resolve the problem the user in this thread Use a Wiegand RFID Reader wants to solve without writing a custom node.