part-file

0.1.0 • Public • Published

part-file

Read and write parts to a file with random access support

npm install part-file

usage

var partFile = require('part-file');
 
var file = partFile('my-file.txt', 1024, [ // 1024 is the part size
    'sha1 hex of first part',
    'sha1 hex of second part'
]);
 
file.on('readable', function(partNumber) {
    // when a part becomes readable this event will be called
});
 
file.write(partNumber, buffer, function(err) {
    // if the hash doesnt match there will be an error
});
 
file.read(partNumber, function(err, buffer) {
    // if part hasnt been written there will be an error
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.1.0
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.1.0
    0
  • 0.0.1
    1

Package Sidebar

Install

npm i part-file

Weekly Downloads

1

Version

0.1.0

License

none

Last publish

Collaborators

  • mafintosh