Skip to content

Instantly share code, notes, and snippets.

@dominictarr
Created December 2, 2019 08:12
Show Gist options
  • Select an option

  • Save dominictarr/28f65288b5991bb9f109150930a5f6a4 to your computer and use it in GitHub Desktop.

Select an option

Save dominictarr/28f65288b5991bb9f109150930a5f6a4 to your computer and use it in GitHub Desktop.
aggregate muxrpc-usage help
module.exports = function (sbot, cb) {
var help = null
sbot.help(function (err, data) {
if(!data.type) data.type = 'group'
help = data
var keys = Object.keys(sbot)
var n = keys.length + 1
keys.forEach(function (key) {
if(sbot[key] && 'function' === typeof sbot[key].help)
sbot[key].help(function (err, data) {
if(!data.type) data.type = 'group'
help.commands[key] = data
done()
})
else --n
})
done()
function done (err) {
if(--n) return
cb(null, help)
}
})
}
if(!module.parent)
require('ssb-client')(function (err, rpc) {
if(err) throw err
module.exports(rpc, function (err, data) {
console.log(JSON.stringify(data, null, 2))
rpc.close()
})
})
@Timeline12
Copy link

I am really impressed with the topics you share, I will visit your posts more often. nytimes crossword

@markorevoluciondesign
Copy link

Excellent work in developing the website's code and features. The structure is clear, the functions are well thought out, and the attention to detail is evident. catalogos andrea 2026 Without a doubt, it's a solid foundation that enhances the user experience and demonstrates a high level of technical skill.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment