boggan / unrar.js Goto Github PK
View Code? Open in Web Editor NEWPure javascript unrar library. salvaged from bitjs
License: MIT License
Pure javascript unrar library. salvaged from bitjs
License: MIT License
Hi, how I can use streams? My file size 50gb and I haven't a lot of RAM
Windows user here and apologizes for my offensive word usage.
Already overwhelmed by the libraries out there, it's damn hard to get a single one worked. The closest working one I came across is that Chinese made Library (Shit can't write files, only read list - good one anyway) and the rest including yours are not working.
I love your library as it implemented in pure JS rather a wrapper around unrar binary
However, my heart got broken when I ran my first code using your lib. The thing output following,
unpackedFiles.forEach(function(file){
^
TypeError: Cannot read property 'forEach' of undefined
My code is similar to your sync example!
As async usage gives me an error on extract (issue #2), i want to try to extract using sync method.
the problem is i can not save extracted files on disk, and set output directory.
I tried to save file.data using streamWriter for each unpacked files. but could not make it work.
is it possible to automate extraction by setting output path like you do in async method?
Trying to async extract a rar file, after finishing the process, this error shows and some of extracted files are broken.
Uncaught Error: kill ENOSYS
at exports._errnoException (util.js:1022)
at ChildProcess.kill (internal/child_process.js:389)
at ChildProcess.childProcess.on (E:\Projects\Electron\electron-starter\node_modules\unrar-js\unrar.js:153)
at emitTwo (events.js:106)
at ChildProcess.emit (events.js:191)
at process.nextTick (internal/child_process.js:752)
at _combinedTickCallback (internal/process/next_tick.js:67)
at process._tickCallback (internal/process/next_tick.js:98)
exports._errnoException @ util.js:1022
ChildProcess.kill @ internal/child_process.js:389
childProcess.on @ E:\Projects\Electron\electron-starter\node_modules\unrar-js\unrar.js:153
emitTwo @ events.js:106
emit @ events.js:191
process.nextTick @ internal/child_process.js:752
_combinedTickCallback @ internal/process/next_tick.js:67
_tickCallback @ internal/process/next_tick.js:98
`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 %
Maybe you can add your repo to https://github.com/sindresorhus/awesome-nodejs#compression, it seems to fit.
See the contribution guidelines if you are interested: https://github.com/sindresorhus/awesome-nodejs/blob/master/contributing.md
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.