Get unlimited public & private packages + team-based management with npm Teams.Learn more »

reward

1.0.0 • Public • Published

Reward

Reward System

Reward is a simple reward system written in NodeJS.

INSTALLING

Using Git:

git clone https://github.com/active9/reward
cd reward*
npm install

Using NPM:

npm install reward

MODULE

Above may run included as a module in your projects.

var reward = require('reward');
 
reward.add('welcome', function() {
    return 'Hello World';
});
 
reward.get('welcome', function(result) {
    if (!result) {
        console.log('welcome not found');
    }
    console.log('welcome:', result());
});
 
reward.remove('welcome', function() {
    console.log('Removed welcome reward');
});
 
reward.get('welcome', function(result) {
    if (!result) {
        console.log('welcome not found');
    }
});
 
reward.add('goodbye', function() {
    return 'Bye!';
});
 
reward.list(function(rewards) {
    console.log('Rewards:', rewards);
});
 

EXAMPLES

More examples in the examples folder on the github repo.

~Enjoy!

CONTRIB

Reward is open-source via the MIT license we encourage Forking.

LICENSE

MIT

Install

npm i reward

DownloadsWeekly Downloads

4

Version

1.0.0

License

MIT

Last publish

Collaborators

  • avatar