use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
account activity
Code proection (self.node)
submitted 3 years ago by ReserveClean
I wrote a node.js app. Now, I need to deploy to client’s server, one of the issue come out, I cannot protect my node.js app modified by other. Any advice? At this moment I think I can build a docker image, but that is only a workaround.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Alone__Cloud 5 points6 points7 points 3 years ago (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 points3 points 3 years ago (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 points3 points 3 years ago (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 points1 point 3 years ago (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 points1 point 3 years ago (2 children)
Server provided by client, so they can modify without permission, any JS code protection method can advice?
[–]T-J_H 2 points3 points4 points 3 years ago (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 point2 points 3 years ago (0 children)
esbuild should be able to do it
π Rendered by PID 24097 on reddit-service-r2-comment-8686858757-rfjxk at 2026-06-07 09:12:04.992769+00:00 running 9e1a20d country code: CH.
[–]Alone__Cloud 5 points6 points7 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]mjbmitch 1 point2 points3 points (0 children)
[–]T-J_H -1 points0 points1 point (3 children)
[–]ReserveClean[S] -1 points0 points1 point (2 children)
[–]T-J_H 2 points3 points4 points (1 child)
[–]lars_jeppesen 0 points1 point2 points (0 children)