deferred-random-access

1.0.0 • Public • Published

deferred-random-access

A random-access instance that wraps another instance that is created async.

npm install deferred-random-access

Usage

var dra = require('deferred-random-access')
var ram = require('random-access-memory')
 
var storage = dra(function (cb) {
  process.nextTick(function () {
    console.log('creating instance')
    cb(null, ram())
  })
})
 
storage.write(0, Buffer.from('hi'), function () {
  console.log('totally wrote it', storage.length)
  storage.read(0, 2, console.log)
})

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i deferred-random-access

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • mafintosh