bf
v1.0.0
Published
Bf - bufferfile - a nodejs file descriptor abstraction that you can use with [Buffer](https://nodejs.org/api/buffer.html) signatures.
Downloads
37
Readme
bf - a nodejs file descriptor abstraction that you can use with Buffer signatures.
Motivation
The stream API cannot seek easily, bl works fine, but load all your file in memory (that i cannot afford). The fs API is "good enough" yet i need the buffer signatures (readUInt & co) - hence bufferfile.
API/example
const bf = require('bf');
//opens file descriptor
var file = new bf('somefile.txt', 'r');
//read an int from fd
var int = file.readInt32BE(1024);
Extra signatures
- buffer.close() - close the fd (!)
bufferfile provide an internal offset so you can
- buffer.seek(pos)
- all readXX are based on the internal offet (as default default)
- all readXX are doubled with "consumeXX" signature that'll make the internal offset walk