If i have a class, what is the best way to share that class and use it in both the browser as well as Node.js?
For example a game that uses a 2D Vector math class on both the client-side and the node.js.
NowJS is a pretty elegant way to share variables and functions between client JS and Node JS through an automatically sync'ed shared namespace.
There's also dnode, which the author comments on in response to a posting about NowJS here: http://news.ycombinator.com/item?id=2316079
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With