title: How to create a json object from predefined json template in node.js
body: <p>I am working in node.js. I get a json object from a service with some fields say:</p>
  
  <pre><code>{
    user: {
      firstname : 'John',
      lastname : 'Doe',
      emailaddress : 'john.doe@example.com',
      contactnumber: '9876458910'
    }
  }
  </code></pre>
  
  <p>The above json data is fetched from a excel/csv file and converted to json data.
  But the json structure of another service which stores this data into database has another format say,</p>
  
  <pre><code>{
    user : {     
      name: {
        firstname : 'John',
        lastname : 'Doe'
      },
      emailaddress : [{
        emailaddress : 'john.doe@example.com'
      }],
      conatactdetails:[{
        contactnumber : '9876458910'
      }]
    }
  }
  </code></pre>
  
  <p>Is it possible to achieve this transformation</p>