Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    smartbufferpublic

    node-smartbuffer

    An auto realloc buffer

    Note

    • buffer will auto realloc with buffer.append method when overflowed.
    • realloc step by power of 2 for example smartbuffer ** [1,,].realloc() make 1,,,_ ** [1,,].realloc(5) make [1_,,,,,,]

    usage

    SmartBuffer = require("smartbuffer").SmartBuffer;
    var buf = new SmartBuffer(5);
    buf.append("123"); // make ['1','2','3',_,_]  
    buf.getFixedBuffer(); // get buffer ['1','2','3'] 
    buffer.append("456"); // auto realloc and make ['1','2','3','4','5','6',_,_]

    Keywords

    none

    install

    npm i smartbuffer

    Downloadsweekly downloads

    2

    version

    0.0.1

    license

    none

    repository

    githubgithub

    last publish

    collaborators

    • avatar