git ssb

7+

dinoworm ๐Ÿ› / patchcore



Tree: 7c9bf5c52715e63fa7ec858e0b747dbabe1c5a22

Files: 7c9bf5c52715e63fa7ec858e0b747dbabe1c5a22 / 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