seek() equivalent in javascript/node.js?

后端 未结 2 902
暗喜
暗喜 2020-12-19 00:52

I m currently trying to read some files with fs module for node.js. Since it lack a tot of the function I m used to (fseek(), getline()...), I m creating another module to g

2条回答
  •  一生所求
    2020-12-19 01:19

    This package is worth looking at: https://npmjs.org/package/fs-ext

    Besides the package, Closest I could find would be : http://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options or using these parameters on fs.read

    length is an integer specifying the number of bytes to read.
    
    position is an integer specifying where to begin reading from in the file. If position is null, data will be read from the current file position.
    

提交回复
热议问题