Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
return function(opts) {
delete opts[0]
delete opts._
var keys = require('ssb-keys').loadSync(path.join(config.path, 'secret'))
var rpc = scuttlebot.createClient({port: config.port, host: 'localhost'})
// if there's data coming from stdin, pipe that into our command
if(!process.stdin.isTTY) {
pull(
toPull.source(process.stdin),
pull.collect(function (err, ary) {
var str = Buffer.concat(ary).toString('utf8')
var data = JSON.parse(str)
next(data)
})
)
}
else
next(opts)
}).map(function (file) {
return ssbKeys.loadSync(path.join(dir, file))
})