1.0.2 • Published 8 years ago

achievement v1.0.2

Weekly downloads
6
License
MIT
Repository
github
Last release
8 years ago

#Achievement Event Driven Reward System

Achievement is a simple event driven reward system written in NodeJS.

#INSTALLING Using Git:

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

Using NPM:

npm install achievement

#MODULE Above may run included as a module in your projects.

var achievement = require('../');

achievement.rewards.add('New User', function() {
	return 'New User Achievement';
});

achievement.once('New User', function(user, cb) {
	achievement.rewards.get('New User', function(result) {
		return cb(result(), user);
	});
});

achievement.emit('New User', 'Joe', function(result, user) {
	// You could expand this to use push or desktop notification methods
	console.log('Achievement:', result, user);
});

achievement.emit('New User Again', 'Joe', function(result, user) {
	// This should not emit again
	console.log('Achievement Again:', result, user);
});

~Enjoy!

#CONTRIB

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

#LICENSE MIT

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago