Is it possible to launch a script using node while the files are hosted on a server?

Viewed 54

Not sure if this exact question has come up before because no matter what I can't find the correct wording for my situation.

I have a folder on my desktop called "Script". Inside this folder I have a bunch of different files and folders.

I also have a .bat file that says:

cd "C:/Users/Name/Desktop/Script/"
node file.js

inside of it. All this does is execute the file using node.

Now here's my problem, I want other people to be able to launch this script as well without giving them all the files. I can't have them see the source code for the script.

So I was wondering if I uploaded the entire folder to my web host, is there a possible way for a command like

cd "websitehostname.com/files/"
node file.js

and then the script would execute on their computer just as it was on mine? Or is this not possible.

1 Answers

Had a similar problem.

If not letting people see the source code is the necessity. I would rather suggest you compile an uglified/obfuscated version of the source code and then send it across to people.

You could understand more about code obfuscation here

Most of the websites do the same.

You could even compile your source code into native code using Enclose JS library

Related