• It depends on the size of the array I guess, and whether you want it human readable or not.

    Text

    // write
    fs.writeFileSync("foo.txt", array.toString());
    // read
    array = new Float32Array(JSON.parse(fs.readFileSync(­"foo.txt")));
    

    Binary

    // write
    fs.writeFileSync("foo.bin", E.toString(array.buffer));
    // read
    array = new Float32Array(E.toArrayBuffer(fs.readFile­Sync("foo.txt")));
    

    For bigger arrays binary would be better, and for very big arrays you'd be looking at multiple save calls.

About

Avatar for Gordon @Gordon started