-2

I have a node web app where i want to hide js files which I have created for the client side?

how can this be achieved? I do not want people viewing the files.

tjhack
  • 1,022
  • 3
  • 20
  • 43

4 Answers4

2

Node runs on the server. All the JavaScript that runs on the server can be hidden. Any JavaScript delivered to the client and run in the user's browser cannot be hidden (though it can be obfuscated).

Michael Aaron Safyan
  • 93,612
  • 16
  • 138
  • 200
0

You cannot "hide" the JS files since the JS interpreter also has to be able to access them.

You can however obfuscate them, so that they cannot be easily read.

Alnitak
  • 334,560
  • 70
  • 407
  • 495
0

It is not possible but you can use something like uglify to make the javascript unintelligible.

leszek.hanusz
  • 5,152
  • 2
  • 38
  • 56
0

You cannot hide the js files but you can provide security to the JS files by minifying them.

You can find many minifier in the online.

JS Compressor is a one of the minifiers.

Try it.

Madhu
  • 2,416
  • 3
  • 15
  • 33