Using npm module

Welcome to the forums @Greg50100,

It may be worth searching for a Node that has already wrapped this in a Node RED Node, search here : https://flows.nodered.org

If not, it may still be possible, but its going to require some setup.

  1. Ensure your installation allows to use 3rd party modules in Function nodes.
    You do this by enabling a setting in settings.js line 455.

    functionExternalModules: true,
    Screenshot 2023-10-12 at 17.55.43
    settings.js is usually in your Node Red user directory (example /home/pi/.node-red/settings.js)

  1. Restart Node RED

  2. In a function node declare its use under setup
    Screenshot 2023-10-12 at 17.59.46

  3. Then the various code blocks in the function node will now be able to use its exports
    astronomyEngine.something