Distributed notes/password manager
npm install autopass
First choose if you wanna pair or make a new instance.
import Autopass from 'autopass'
import Corestore from 'corestore'
const pass = new Autopass(new Corestore('./pass'))
const inv = await pass.createInvite()
console.log('share to add', inv)
Then invite another instance
const pair = Autopass.pair(new Corestore('./another-pass'), inv)
const anotherPass = await pair.finished()
await anotherPass.ready()
When paired you can simply start the instance again with the normal constructor.
await pass.add('a-note', 'hello this is a note')
Then on the other node you get it out with
const note = await pass.get('a-note')
console.log({ note })
Make a new pass instance.
Triggered when it updates, ie something added/removed an entry
Get an entry.
Get all entries.
Add new entry
Remove an entry.
Remove a writer explictly.
Add a writer explictly.
Get the local writer key.
Get invite to add a writer.
Wait for the pass to load fully
Pair with another instance.
Wait for the pair to finish.
Force close the pair instance. Only need to call this if you dont wait for it to finish.get
Fully close the pass instance.
Written with big contributions from @supersu