Skip to content

Instantly share code, notes, and snippets.

@davistrent
davistrent / config.js
Created August 6, 2017 19:18
async config
module.exports = new Promise((resolve, reject) => {
console.log('config module loaded!');
const foo = {};
getAsyncConfig(foo)
.then(config => {
resolve(config);
});
});
function getAsyncConfig(foo) {
var re = /#(foo|bar|baz)/i;
var message = '@bot #bAz';
var tagAttributes = message.match(re);
var tag = tagAttributes[1].toLowerCase();
console.log(tag);