hyperdrive-next
hyperdrive-next copied to clipboard
`drive.put(...)` should return the version at which the file was added
Currently drive.put(...) resolves to undefined. This makes it tricky to know at which exact version a file was added to the drive. Returning the version or the node which was added would make this easy.
Illustration of current behaviour:
const Corestore = require('corestore')
const Hyperdrive = require('hyperdrive')
const ram = require('random-access-memory')
async function main () {
const drive = new Hyperdrive(new Corestore(ram))
const res = await drive.put('I add', 'something')
console.log('res:', res) // res: undefined
}
main()