Skip to content

Instantly share code, notes, and snippets.

@vdavez
Last active October 14, 2017 13:57
Show Gist options
  • Save vdavez/efef2247a0b52f7e47f6 to your computer and use it in GitHub Desktop.
Save vdavez/efef2247a0b52f7e47f6 to your computer and use it in GitHub Desktop.
Onboarding
#!/usr/bin/env node
var utils = require('./utils');
/**
* @param {Object} - the configuration object
*/
var addUser = (opts) => {
utils._addToGithub(opts.user);
utils._addToSlack(opts.user, opts.channel);
}
module.exports = addUser;
var addUser = require('./onboard');
var options = {
'channel': 'testchannel',
'user':{'github': 'test', 'slack': 'testing'}
};
addUser(options);
#!/usr/bin/env node
/**
* @param {Object} - the user to be added
*/
exports._addToGithub = user => {
console.log("user " + user["github"] + " added to github.");
}
/**
* @param {Object} - the user to be added
* @param {string} - the channel to be added to
*/
exports._addToSlack = (user, channel) => {
console.log("user " + user["slack"] + " added to slack channel " + channel + ".");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment