Neverending Pile of Messages

    share-memory-win

    1.2.1 • Public • Published

    share-memory-win

    a share memory module between diffrent process on windows. runtime nodejs/electron.

    example

    const smemory = require('share-memory-win');
    console.log('Init Share Memory=>', smemory);
    
    
    let ret = smemory.CreateShareMemory('my-addon-test-memory', 64);
    console.log('CreateShareMemory=>', ret);
    //CreateShareMemory=> true
    
    
    let writebuff = Buffer.alloc(10);
    writebuff[0] = 9;
    writebuff[1] = 7;
    writebuff[2] = 5;
    writebuff[3] = 3;
    writebuff[4] = 1;
    ret = smemory.WriteShareMemory('my-addon-test-memory', writebuff);
    console.log('WriteShareMemory=>', ret);
    //WriteShareMemory=> true
    
    
    let readbuff = Buffer.alloc(10);
    ret = smemory.ReadShareMemory('my-addon-test-memory', readbuff);
    console.log('ReadShareMemory=> ', ret, readbuff);
    //ReadShareMemory=>  true <Buffer 09 07 05 03 01 00 00 00 00 00>
    
    
    ret = smemory.DeleteShareMemory('my-addon-test-memory');
    console.log('DeleteShareMemory=> ', ret);
    //DeleteShareMemory=>  true
    
    
    readbuff = Buffer.alloc(10);
    ret = smemory.ReadShareMemory('my-addon-test-memory', readbuff);
    console.log('ReadShareMemory=> ', ret, readbuff);
    //ReadShareMemory=>  false <Buffer 00 00 00 00 00 00 00 00 00 00>

    install

    nodejs

    npm i share-memory-win

    electron

    npm i share-memory-win
    npm i --save-dev electron-rebuild
    npm i --save-dev electron-prebuilt
    .\node_modules\.bin\electron-rebuild.cmd -v 10.1.5/your electron version -w share-memory-win
    

    Install

    npm i share-memory-win

    DownloadsWeekly Downloads

    0

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    13.5 kB

    Total Files

    9

    Last publish

    Collaborators

    • gaobowen100