I want to use node.js in my next project, but my boss does not like that our competitors can read the source code.
Is there a way to protect the JavaScript code?
Package your core logic into modules.. these modules can be built then run through Google's closure. You could even be able to do this as a Grunt task as part of your build process.
It's an old question but worth pointing out. Note: nothing you do will truly hide your code, but neither will anything shipped via .Net (C#) or Java for that matter. In general, simply using a tool like uglify, or closure should be enough of an obfuscation point. By being modular and using closure you can actually do a lot of optimizations that otherwise would be difficult.