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

**URL:** <https://discourse.nodered.org/t/setup-and-close-of-new-function-node-discussion-about-use-cases-extensions/29570>\
**Category:** General\
**Created:** [5 July 2020 21:26 UTC](https://discourse.nodered.org/t/setup-and-close-of-new-function-node-discussion-about-use-cases-extensions/29570 "2020-07-05T21:26:39Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![cinhcet](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cinhcet/32/438_2.png) [@cinhcet](https://discourse.nodered.org/u/cinhcet)\
**Post date:** [5 July 2020 21:57 UTC](https://discourse.nodered.org/t/setup-and-close-of-new-function-node-discussion-about-use-cases-extensions/29570/5 "2020-07-05T21:57:12Z")

</div>

(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](https://discourse.nodered.org/t/use-a-wiegand-rfid-reader/29565) wants to solve without writing a custom node.

---

_[View the full topic](https://discourse.nodered.org/t/setup-and-close-of-new-function-node-discussion-about-use-cases-extensions/29570)._
