title: Nodejs - Error using properties-reader package
body: <p>I am trying to write a generic properties reader utility using <code>properties-reader</code> package of <code>nodejs</code>. Following is implementation:</p>
  
  <pre><code>var propertiesReader = require('properties-reader')
  var path = require('path')
  
  var property = getPropertyFile('./fileName.properties');
  console.log(getProperty(property,'user1.username'))
  
  function getPropertyFile(err, filePath){
      if(err){
          console.log("Error occured while reading properties file: "err);
      }
      else{
          return propertiesReader(filePath);
      }
  }
  
  function getProperty(err, propertyFile, propertyName){
      if(err){
          console.log("Error occured while getting properties: ",err);
      }
      else{
          return propertyFile.get(propertyName)
      }   
  }
  </code></pre>
  
  <p>on executing above code I am getting error in reading file and getting property value as below:</p>
  
  <pre><code>E:\NodeJS\&gt;node propertiesUtility.js
  Error occured while reading properties file:  ./locatorValues.properties
  E:\NodeJS\propertiesUtility.js:24
                  return propertyFile.get(propertyName)
                                      ^
  
  TypeError: propertyFile.get is not a function
      at getProperty (E:\NodeJS\propertiesUtility.js:24:23)
      at Object.&lt;anonymous&gt; (E:\NodeJS\propertiesUtility.js:5:13)
      at Module._compile (module.js:435:26)
      at Object.Module._extensions..js (module.js:442:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:313:12)
      at Function.Module.runMain (module.js:467:10)
      at startup (node.js:136:18)
      at node.js:963:3
  </code></pre>
  
  <p>Can someone please help me in correcting my code.</p>