Hi,
I dev. some node to recreate my settings.js file on a new machine Warning : If you have specifics settings.js or low NR experience don't try this node
I use sublflow $env variable to modify this scripting (i turn off recreate the file for the NR Padawan)
I try also using the command : **node-red admin hash-pw" --> it's working but ask user entry and i don't know how to manage user entry (in scripting bash)
If you have some optimisations,comments... tell me.
If you are writing a custom node, why not use the bcryptjs module directly?
But honestly, if you aren't a node.js programmer, I wouldn't recommend jumping in and creating a custom node. There are a lot of things to think about and you could easily do this using a flow.
Then you probably don't want to write a custom node unless you want to become a node.js programmer!
To use the node -e "console.log(require('bcryptjs').hashSync(process.argv[1], 8));" {{payload}} command, firstly you have to be in the userDir folder. Then the {{payload}} part needs to be a valid string for the command.
HAve a look at how to use the exec command and understand that the exec environment in Node-RED isn't the same as from a terminal.