1.0.1 • Published 8 years ago
fileslice v1.0.1
fileslice
Copy a slice of a file.
Installation
Install fileslice by running:
$ npm install --save filesliceDocumentation
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:
startis the number of bytes determining where to start copying from.endis 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 testContribute
- 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 lintSupport
If you're having any problem, please raise an issue on GitHub.
License
The project is licensed under the MIT license.
