node.jswindowscmdpathjohnny-five

Open file in another folder with node js


I am trying to open a file on another folder with nodejs using an absolute path.
This file contains a js program that has to be executed the node.
I am using johnny five to program an Arduino but the file is not in the same folder as the node files and the libraries.
How can this be done?


Solution

  •  require('C:\\run.js')
    

    This will get 'run.js' file from C disk. But if you already tried this, than please can you explain in more detail what you want to do?