How to use the hyperdrive/lib/messages.Stat.decode function in hyperdrive

To help you get started, we’ve selected a few hyperdrive examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github datproject / dat-storage / index.js View on Github external
metadata.get(i, {valueEncoding: messages.Node}, function (err, node) {
    if (err) return cb(err)

    var st = node.value && stat.decode(node.value)

    if (!node.value || (!st.offset && !st.blocks) || (!st.byteOffset && !st.blocks)) {
      return get(metadata, btm, i - 1, cb) // TODO: check the index instead for fast lookup
    }

    cb(null, i, node, st)
  })
}
github tom-james-watson / dat-cp / src / lib / storage.js View on Github external
metadata.get(i, {valueEncoding: messages.Node}, function(err, node) {
    if (err) {
      return cb(err)
    }

    const st = node.value && Stat.decode(node.value)

    if (!node.value || (!st.offset && !st.blocks) || (!st.byteOffset && !st.blocks)) {
      return get(metadata, btm, i - 1, cb)
    }

    cb(null, i, node, st)
  })
}

hyperdrive

Hyperdrive is a secure, real-time distributed file system

Apache-2.0
Latest version published 2 days ago

Package Health Score

74 / 100
Full package analysis