I have a JavaScript file that I want to run on a remote server. I dont have access to move the script to the server so I want to be able to run the script from my local machine with a remote side argument (filename). Essentially its a script that takes in a file name as an argument and then searches the file that's on the remote server. I tried the following but I get an error code 1. Will i need to write a bash script instead?
ssh name@remote.server 'node filename' < script.js
Here is an image of the script on my local machine and the text on the remote server