Continuous reading or writing to a file using random offsets and lengths
Random Access File allows you to read or write to a file using random offsets and lengths
npm install random-access-file
var raf = require'random-access-file';var file = raf'my-file.txt'size: 1024 // if a size is given the file will be truncted to fit this size;filewrite10 'hello'// write a buffer to offset 10fileread10 5console.logbuffer; // read 5 bytes from offset 10;;
The file will use an open file descriptor.
When you are done with the file you should call