2.0.1 • Published 8 years ago

bonus-calculation v2.0.1

Weekly downloads
-
License
MIT
Repository
-
Last release
8 years ago

#Bonus calculation

##Module expects object with schema:

{  
    "type": "object",  
    "properties": {  
      "members": {  
        "type": "array",  
        "items": {  
          "type": "object",  
          "properties": {  
            "name": {  
              "type": "string"  
            },  
            "salary": {  
              "type": "integer"  
            },  
            "engagement": {  
              "type": "integer"  
            }  
          },  
          "required": [  
            "name",  
            "salary",  
            "engagement"  
          ]  
        }  
      },  
      "bonusPercent": {  
        "type": "integer"  
      }  
    },  
    "required": [  
      "members",  
      "bonusPercent"  
    ]  
  }  

##example object :

{  
    "members": [  
        {"name": "Artem", "salary": 5000, "engagement": 42},  
        {"name": "Mario", "salary": 2000, "engagement": 31},  
        {"name": "Luigi", "salary": 3000, "engagement": 27}  
    ],  
    "bonusPercent": 28  
}  

##example usage

node myApp.js ./data.json  

##myApp.js file content:

var bonusCalculator = require("./bonus-calculation.js");  
var data = require(process.argv[2]);  
console.log(bonusCalculator(data));  
2.0.1

8 years ago

2.0.0

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago