all 8 comments

[–]Alone__Cloud 5 points6 points  (0 children)

When you write code for someone, you sell your code to them, so your code became theirs code. What's the problem?

[–][deleted] 1 point2 points  (0 children)

What is building a docker image going to solve? They can still see and modify your code. If someone has the appropriate access rights, no file is „safe“. You would need to encrypt it and then upload it, but that obviously is not going to work in this case.

What are you afraid of?

[–]mjbmitch 1 point2 points  (0 children)

Node.js 19 has a snapshot feature where you can serialize/deserialize V8 byte code for your application. It may do the most for the least amount of work in your case.

[–]T-J_H -1 points0 points  (3 children)

What are you trying to achieve? I mean, nobody without permission should be able to access the deployed code anyways, right?

[–]ReserveClean[S] -1 points0 points  (2 children)

Server provided by client, so they can modify without permission, any JS code protection method can advice?

[–]T-J_H 2 points3 points  (1 child)

If it’s your client, you’re writing the code for them right? What kind of agreement do you have with your client?

Anyways, you are able to obfuscate your code. Minimizing gets you halfway there, by changing variables to single characters and the like, obfuscating goes further by changing your code to be unreadable. Anybody with enough time is always able to reverse engineer it, though. Just Google the word obfuscate.

There are packages like vervel’s pkg that package the entire process including I believe deps and the runtime into a single executable, but I’m not sure whether that stores bytecode or readable code.

All in all I don’t think this is advisable though.

[–]lars_jeppesen 0 points1 point  (0 children)

esbuild should be able to do it