unrar

Unrars rar archives

unrar

Unrars rar archives with unrar utility

npm install unrar

You must have unrar tool in the path

var Unrar = require('unrar');
 
var archive = new Unrar('archive.rar');
// or 
// var archive = new Unrar({ 
//   path:      protectedArchivePath, 
//   arguments: ['-pPassword'] 
// }); 
 
archive.list(function (errentries) {
  var stream = archive.stream('some_binary_entry'); // name of entry 
  stream.on('error', console.error);
  stream.pipe(require('fs').createWriteStream('some-binary-file'));
});
var Unrar = require('unrar');
var archive = new Unrar('/path/to/some/file.rar');
  • options String|Object File path or options object
    • path String File path
    • arguments Array Additional arguments for unrar command
  • callback Function
    • error Error
    • entries Array Descriptions of archive entries
  • entryName String Name of entry for extracting

Returns readable stream