Unrars rar archives with unrar utility
npm install unrar
You must have unrar tool in the path.
For windows download from http://www.rarlab.com/rar_add.htm
var Unrar = require('unrar');
var archive = new Unrar('archive.rar');
// or
// var archive = new Unrar({
// path: protectedArchivePath,
// arguments: ['-pPassword'],
// bin: pathToUnrarBin // Default: unrar
// });
archive.list(function (err, entries) {
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');optionsString|Object File path or options objectpathString File pathargumentsArray Additional arguments forunrarcommand
callbackFunctionerrorErrorentriesArray Descriptions of archive entries
entryNameString Name of entry for extracting
Returns readable stream