lib/node-fs.js
function readChunk(path, start, end, callback) {
  if (end < 0) {
    return readLastChunk(path, start, end, callback);
  }
  var stream = nodeFs.createReadStream(path, {
    start: start,
    end: end - 1
  });
  var chunks = [];
  stream.on("readable", function () {
    var chunk = stream.read();
    if (chunk === null) return callback(null, Buffer.concat(chunks));
    return chunks.push(chunk);
  });
  stream.on("error", function (err) {
    if (err.code === "ENOENT") return callback();
    return callback(err);
  });
}
function readChunk(path, start, end, callback) {
  if (end < 0) {
    return readLastChunk(path, start, end, callback);
  }
  var stream = nodeFs.createReadStream(path, {
    start: start,
    end: end - 1
  });
  var chunks = [];
  stream.on("readable", function () {
    var chunk = stream.read();
    if (chunk === null) return callback(null, Buffer.concat(chunks));
    return chunks.push(chunk);
  });
  stream.on("error", function (err) {
    if (err.code === "ENOENT") return callback();
    return callback(err);
  });
}
function readChunk ( path , start , end , callback ) { if ( end < 0 ) { return readLastChunk ( path , start , end , callback ) ; } var stream = nodeFs . createReadStream ( path , { start : start , end : end - 1 } ) ; var chunks = [ ] ; stream . on ( "readable" , function ( ) { var chunk = stream . read ( ) ; if ( chunk === null ) return callback ( null , Buffer . concat ( chunks ) ) ; return chunks . push ( chunk ) ; } ) ; stream . on ( "error" , function ( err ) { if ( err . code === "ENOENT" ) return callback ( ) ; return callback ( err ) ; } ) ; }
Reads bytes from inclusive [start, end) exclusive for given path. => binary => undefined if file does not exist
Reads bytes from inclusive [ start end ) exclusive for given path . = > binary = > undefined if file does not exist