Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including reward with all npm packages installed. Try it out:

var reward = require("reward")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

reward v1.0.0

Reward System

#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

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free