Have ideas to improve npm?Join in the discussion! »

    shared-array-buffer-store

    1.0.0 • Public • Published

    sharedArrayBufferStore

    use sharedArrayBuffer to store data

    Install

    npm install shared-array-buffer-store
    

    How to use

    const SharedArrayBufferStore = require('shared-array-buffer-store');
    const instance = new SharedArrayBufferStore(options);
    //set data
    instance.set('name', 'value');
    //get data
    instance.get('name');
    //delete key
    instance.delete('name');
    // get all keys
    const keys = instance.keys();

    options

    • keyBuffer {sharedArrayBuffer} store key buffer
    • keyBufferLength {Number} store key buffer size, default is 1024 * 1024 * 5
    • valueBuffer {sharedArrayBuffer} store value buffer
    • valueBufferLength {Number} store key buffer size, default is 1024 * 1024 * 100
    • reservedLength {Number} reserved size in key buffer and value buffer, default is 1
    • encrypt
      • encode(string, encoding)
      • decode(buffer, encoding)

    Install

    npm i shared-array-buffer-store

    DownloadsWeekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    30 kB

    Total Files

    14

    Last publish

    Collaborators

    • avatar