title: How can i export variable to other files using nodejs?
body: <p>I am new to nodejs i just want to bring data from event.js to app.js its in same directory but i could not get it working any idea how to make it work ?</p>
  
  <p>app.js</p>
  
  <pre><code>var SnmpData = require('./event.js');
  console.log('SNMP data',SnmpData);
  </code></pre>
  
  <p>event.js</p>
  
  <pre><code>var message = {
      event: {
          header: {
              eventSource: "d-sms"
          },
          body: {
              data: [
                  {
                      oid: "1.3.6.1.4.140.625",
                      host: "135.89.157.201",
                      port: "162",
                      value: "Problem with monitoring device",
                      type: ""
                  },
                  {
                      oid: "1.3.6.1.4.345.765",
                      host: "135.89.157.299",
                      port: "162",
                      value: "Problem with monitoring device-2",
                      type: ""
                  }],
              message: "Activate Collaborate"
          }
      }
  }
  }
  </code></pre>