🚀 Launch Week Day 3:Introducing Supply Chain Attack Campaigns Tracking.Learn More →
Socket
Book a DemoInstallSign in
Socket

deferred-random-access

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deferred-random-access

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

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

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

FAQs

Package last updated on 29 Apr 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts