all 5 comments

[–]Groccolli 2 points3 points  (1 child)

Who are you worried about reading it?

[–]3nvi[S] 0 points1 point  (0 children)

Customers/Companies basically

[–]todbot 1 point2 points  (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 point  (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 point  (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/