You have created some functionality in CoffeeScript that you wish to use on the client with a web browser and on the server with Node.js.
Export the functionality in the following manner:
In the above example, we create a new namespace called SimpleMath. If export is available, our class is exported as a Node.js module. If export is not available, then SimpleMath is added to the global namespace and available to our web page.
In Node.js, we can include our module using the require command.
In our web page, we can include our module by including it as a script.