#!/usr/bin/env node
import Corestore from 'corestore'
import Hyperbee from 'hyperbee'
const store = new Corestore('./pear-git-storage')
const registryCore = store.get({ name: 'registry' })
const registry = new Hyperbee(registryCore, {
keyEncoding: 'utf-8',
valueEncoding: 'json'
})
await registry.ready()
const userId = 'b37118d71bab5f130ac2a183b96767a8'
const entry = await registry.get(`user:${userId}`)
if (entry) {
console.log(JSON.stringify(entry.value, null, 2))
} else {
console.log('User not found')
}
await store.close()