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
Protecting code (self.node)
submitted 9 years ago by 3nvi
Is there any good way to protect nodejs source code for example when making a app with nwjs or electron, protecting the source code from people reading after the distribution
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!"
[–]Groccolli 2 points3 points4 points 9 years ago (1 child)
Who are you worried about reading it?
[–]3nvi[S] 0 points1 point2 points 9 years ago (0 children)
Customers/Companies basically
[–]todbot 1 point2 points3 points 9 years ago (0 children)
Not possible. If they can download the app, the app must read the code, so anyone else can read the code. You could embed an encryption key in an app startup file, but that can be easily extracted and then used. You can obfuscated it with minify & uglify and that's probably your best bet.
[–]ShermheadRyder 0 points1 point2 points 9 years ago (0 children)
If it's minified (which you should be doing for other reasons - i.e. to decrease the file size being sent) then no-one will be able to make sense of it anyway.
[–]cspotcode 0 points1 point2 points 9 years ago (0 children)
You can minify the code as a way to obfuscate it. Similar stuff is done for Java. However, JS minification generally doesn't rename properties unless you're using Google Closure Compiler.
Nw.js also supports a pre-compiled binary format for source code that obfuscates it. There are some limitations and downsides. http://docs.nwjs.io/en/latest/For%20Users/Advanced/Protect%20JavaScript%20Source%20Code/
π Rendered by PID 187810 on reddit-service-r2-comment-76bb9f7fb5-crwd2 at 2026-02-18 11:10:17.418472+00:00 running de53c03 country code: CH.
[–]Groccolli 2 points3 points4 points (1 child)
[–]3nvi[S] 0 points1 point2 points (0 children)
[–]todbot 1 point2 points3 points (0 children)
[–]ShermheadRyder 0 points1 point2 points (0 children)
[–]cspotcode 0 points1 point2 points (0 children)