I see two options for you, the PKG library and the bytenode library
1.PKG:
This command will wrap your nodeJS file and its dependencies into an executable on MacOS, Windows or Linux. If your application is complicated, this may not work.
https://www.npmjs.com/package/pkg
2.Bytenode:
This command line converts your JS files into binary files so that no one can read the code.
- You convert JS files in plain text into binary files
- You create a master JS file in plain text
- You load the bytenode library in a clear JS file using "require"
- You load binary files containing your code using "require"
bytenode is fully integrated with Nodejs. Rather that using "require" to call a JS file in plain text, you use "require" to call a binary file (.JSC with bytenode).
You only convert the target files that you want to convert. However, a little warning. In this case, your regular JS modules are in plain text.
https://www.npmjs.com/package/bytenode