node sharing data between server & client

Viewed 1154

Is there a way using node & socketIo/express to somehow bind an object variable to the client side so it behaves like reactive meteor and stays synchronized the way meteor does it?

in other words, for example i have a JSON object-variable in my node.js script:

var marksObject = {
    firstValue   : 'this is the first value' ,
    secondValue  : 'this is the second value'
};

i am looking for a simple way have marksObject appear to be in both the client and the node-server and synchronized. so if a change happens on either the client or the node-server, the change appears to happen in both places.

ideally this would only involve a few lines of code, and i would not have to write anything to manually keep the client&node-server in sync.

Redis looks very interesting but seems like overkill for what i am attempting.

thank you very much.

2 Answers
Related