@inithink/node-pointer
v1.0.6
Published
Access memory by address (like c++ pointer)
Downloads
1
Readme
node-pointer
Access C++ pointer from node.js code
##Example
readAddress
const assert = require('assert');
const {readAddress} = require('@inithink/node-pointer');
// By using ref-napi, we can get memory address of a Buffer instance
require('ref-napi');
const buf = Buffer.alloc(4);
buf.writeUInt64LE(0x11223344, 0);
let buffer = readAddress(buf.address(), 4);
assert.strictEqual(0x11223344, buffer.readUInt32LE(0));