module - How to extract .rar files in node.js? -
i trying extract .rar files using node.js in windows 8.1. there way this?
thanks in advance
var unrar = require('unrar'), fs = require('fs'), archive = new unrar('t.rar'); archive.list(function(err, entries) { (var = 0; < entries.length; i++) { var name = entries[i].name; var type = entries[i].type if (type !== 'file') { fs.mkdirsync(name) } } (var = 0; < entries.length; i++) { var name = entries[i].name; var type = entries[i].type; if (type !== 'file') { continue; } var stream = archive.stream(name); try { fs.writefilesync(name, stream); } catch (e) { throw e; } } });
please check unrar may
*this script tested on linux ubuntu
Comments
Post a Comment