Open creatxrgithub opened 5 years ago
Hi!
which version of nodejs are you using ?? do you have any error messages ?
if you go into the test folder and run: node test.js does it run or do you get any errors ?
Cheers!
nodejs version is v10.15.2
i run the code above then get the console messages.
it has nothing else error messages.
now, i use unrar-promise. it could unar the file, it just has a problem that it throw exception if the file's name include space.
const {unrar, list} = require('unrar-promise');
async function() { await unrar(f, output); }
`const unrar = require('unrar.js'); const fs = require('fs');
let unpackedFiles;
let rarFile = '/media/creatxr/DATAL/xxx.rar';
unpackedFiles = unrar.unrarSync(rarFile, { onProgress: function(data) { console.log(data); let l_nPercent = Math.round((data.currentBytesUnarchived / data.totalUncompressedBytesInArchive) * 100); console.log("Progress: ", l_nPercent, "%"); } });
unpackedFiles.forEach(function(file){ console.log(file.filename, file.fileData.length); });`
console message:
{ currentFilename: '', currentFileNumber: 0, currentBytesUnarchivedInFile: 0, currentBytesUnarchived: 0, totalUncompressedBytesInArchive: 0, totalFilesInArchive: 0 } Progress: NaN %