This example show how to use an eternal NPM javascript in a function node. This example uses tinycolor.js to test an RGB color to see if it is 'light' or 'dark'.
** Setup **
- Go to the node-red directory
cd .node-red
- Install tinycolor.js
npm install tinycolor2.js
- Backup your settings file incase something goes wrong.
cp settings.js settings.bkup
- Edit
settings.js
and find the sectionfunctionGlobalContext: {
it should look like this