fileslice
v1.0.1
Published
Copy a slice of a file
Downloads
5
Readme
fileslice
Copy a slice of a file.
Installation
Install fileslice
by running:
$ npm install --save fileslice
Documentation
fileslice.copy(String file, String output, Object range, Function callback)
Copy a slice of file
to output
.
The slice is determined by the range
object which contains two fields:
start
is the number of bytes determining where to start copying from.end
is the number of bytes determining where to stop copying.
The callback
received a single argument: (error)
.
The function is implemented using streams, so you can copy big file slices without worrying about memory.
Example:
var fileslice = require('fileslice');
fileslice.copy('input/file', 'output/file', {
start: 512,
end: 2048
}, function(error) {
if(error) throw error;
console.log('The slice of the file was copied.');
});
Tests
Run the test suite by doing:
$ gulp test
Contribute
- Issue Tracker: github.com/jviotti/fileslice/issues
- Source Code: github.com/jviotti/fileslice
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
Support
If you're having any problem, please raise an issue on GitHub.
License
The project is licensed under the MIT license.