Install nodejs and npm

Hi, I have an Odroid N2 running Coreelec with Kodi.

I wanted to be able to write a simple javascript code that runs in the background of Kodi: basically trying to replicate what is done in
In order to do that I need to be able to run nodejs and npm to install certain dependencies (e.g. cec-utils).
I was wondering if anyone has an experience in doing so?

Thanks for help!