Skip to content

Instantly share code, notes, and snippets.

@blahah
Created April 6, 2017 20:22
Show Gist options
  • Select an option

  • Save blahah/89a5731bd642519b2c1e1b12a2541e27 to your computer and use it in GitHub Desktop.

Select an option

Save blahah/89a5731bd642519b2c1e1b12a2541e27 to your computer and use it in GitHub Desktop.
hyperdrive v8 readdir behaviour check
const hyperdrive = require('hyperdrive')
const discover = require('hyperdiscovery')
const key = '33fcb3ea86942f913240d3f39c7c68f81fc2bdefc65cb56646d52a62a90bdec9'
const drive = hyperdrive('.', '')
drive.once('ready', () => {
driveswarm = discover(drive)
drive.once('content', () => {
const start = new Date()
drive.readdir('/meta', (err, files) => {
if (err) throw err
console.log('read meta dir took', (new Date()) - start, 'ms')
stats.set('articleCount', files.length).value()
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment