Socket
Book a DemoInstallSign in
Socket

part-file

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

part-file

Read and write parts to a partfile

latest
Source
npmnpm
Version
0.1.0
Version published
Maintainers
1
Created
Source

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
});

Keywords

parts

FAQs

Package last updated on 07 Apr 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts