git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: c18b233c6d62741496978cd8dc1f34a093946f8b

Files: c18b233c6d62741496978cd8dc1f34a093946f8b / keys.js

454 bytesRaw
1const Path = require('path')
2const Keys = require('ssb-keys')
3const nest = require('depnest')
4
5exports.needs = nest('config.sync.load', 'first')
6exports.gives = nest('keys.sync.load')
7exports.create = (api) => {
8 return nest('keys.sync.load', () => {
9 var keys
10 if (!keys) {
11 const config = api.config.sync.load()
12 const keyPath = Path.join(config.path, 'secret')
13 keys = Keys.loadOrCreateSync(keyPath)
14 }
15 return keys
16 })
17}
18

Built with git-ssb-web