auto-unrar
v0.6.0
Published
Automatic unpack all recursive rar-files from a directory
Downloads
4
Readme
auto-unrar
Functions
autoUnrar(cwd, callback)
Unrar all files recursively if they don't exits given by a entry point root directory.
Kind: global function
| Param | Type | Description | | --- | --- | --- | | cwd | String | Path to search for rar-files | | callback | function | Callback after all data has been unpacked |
Example
autoUnrar('~/Documents/myDirectory', function (err, data) {
// data is an object with archives as keys and entries on data.
// example:
// {
// 'some-file.rar': {
// skip: false,
// outputFile: 'some/path/some-file.dat',
// entry: 'some-file'
// }
// }
});
Example CLI Usage
auto-unrar
Automatic unpack all recursive rar-files from a directory.
Options
-h, --help Display this usage info
-v, --verbose Log all information
--cwd string What folder to use as base directory (root search directory)
-i, --interval number Set interval in minutes for periodic check. Default value is 5 minutes.
Full help (project repo): https://github.com/mikaelbr/auto-unrar
poll(options, callback) ⇒ function
Automatically poll defined by interval recursively from root defined as cwd from the options.
Kind: global function Returns: function - Function to stop polling for packages.
| Param | Type | Description | | --- | --- | --- | | options | String | Object | Path to search for rar-files or options object | | options.cwd | String | Path to search for rar-files | | options.interval | Number | Polling interval in minutes | | options.beforeHook | function | Hook before each unpacking search | | callback | function | Callback after all data has been unpacked |
Example
autoUnrar.poll('~/Documents/myDirectory', function (err, data) {
// data is an object with archives as keys and entries on data.
// example:
// {
// 'some-file.rar': {
// skip: false,
// outputFile: 'some/path/some-file.dat',
// entry: 'some-file'
// }
// }
});
autoUnrar.poll({
cwd: '~/Documents/myDirectory',
interval: 10, // every 10 mintues
beforeHook: function () { console.log('About to search for files') }
}, function (err, data) {
});