Random Entry Memory (REM) - dwCore/dwCore-Wiki GitHub Wiki
Works alongside dwref and maintains dwref's read/write data in memory.
Table of Contents
Background
Works alongside dwref and maintains dwref's read/write data in memory.
Installation
Install With NPM
npm install @dwcore/rem
Install With YARN
yarn add @dwcore/rem
Usage
var dwrem = require('@dwcore/rem')
var dPackFile = dwrem()
dPackFile.dPackWrite(0, Buffer.from('greetings'), function () {
dPackFile.dPackWrite(5, Buffer.from(' martian'), function () {
dPackFile.dPackRead(0, 11, console.log) // returns Buffer(hello world)
})
})
You can also initialize a dwrem
instance with a Buffer
:
var dPackFile = dwrem(Buffer.from('greetings martian'))