node-unrar-js
Advanced tools
Comparing version 1.0.6 to 2.0.0
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -59,3 +59,3 @@ export declare type SeekMethod = 'CUR' | 'SET' | 'END'; | ||
fileHeader: FileHeader; | ||
extraction: withContent; | ||
extraction?: withContent; | ||
}; | ||
@@ -62,0 +62,0 @@ export interface ArcFiles<withContent = never> { |
@@ -86,3 +86,3 @@ "use strict"; | ||
} | ||
if (arcFile.extraction === 'skipped' || arcFile.fileHeader.flags.directory) { | ||
if (arcFile.extraction === 'skipped') { | ||
continue; | ||
@@ -89,0 +89,0 @@ } |
@@ -25,4 +25,6 @@ "use strict"; | ||
for (const file of files) { | ||
file.extraction = | ||
this.dataFiles[this.getExtractedFileName(file.fileHeader.name)].file.readAll(); | ||
if (!file.fileHeader.flags.directory) { | ||
file.extraction = | ||
this.dataFiles[this.getExtractedFileName(file.fileHeader.name)].file.readAll(); | ||
} | ||
yield file; | ||
@@ -29,0 +31,0 @@ } |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } }); | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
@@ -6,0 +10,0 @@ if (k2 === undefined) k2 = k; |
@@ -59,3 +59,3 @@ export declare type SeekMethod = 'CUR' | 'SET' | 'END'; | ||
fileHeader: FileHeader; | ||
extraction: withContent; | ||
extraction?: withContent; | ||
}; | ||
@@ -62,0 +62,0 @@ export interface ArcFiles<withContent = never> { |
@@ -82,3 +82,3 @@ const ERROR_CODE = { | ||
} | ||
if (arcFile.extraction === 'skipped' || arcFile.fileHeader.flags.directory) { | ||
if (arcFile.extraction === 'skipped') { | ||
continue; | ||
@@ -85,0 +85,0 @@ } |
@@ -22,4 +22,6 @@ import { DataFile } from './ExtractorData.helper'; | ||
for (const file of files) { | ||
file.extraction = | ||
this.dataFiles[this.getExtractedFileName(file.fileHeader.name)].file.readAll(); | ||
if (!file.fileHeader.flags.directory) { | ||
file.extraction = | ||
this.dataFiles[this.getExtractedFileName(file.fileHeader.name)].file.readAll(); | ||
} | ||
yield file; | ||
@@ -26,0 +28,0 @@ } |
{ | ||
"name": "node-unrar-js", | ||
"version": "1.0.6", | ||
"version": "2.0.0", | ||
"description": "Pure JavaScript RAR archive extractor by compile the official unrar lib by Emscripten.", | ||
@@ -13,3 +13,3 @@ "homepage": "https://github.com/YuJianrong/node-unrar.js", | ||
"scripts": { | ||
"prepare": "wget http://www.rarlab.com/rar/unrarsrc-6.0.2.tar.gz && tar -xf unrarsrc-6.0.2.tar.gz -C src/cpp && rm -rf unrarsrc-6.0.2.tar.gz && husky install", | ||
"prepare": "wget http://www.rarlab.com/rar/unrarsrc-6.1.7.tar.gz && tar -xf unrarsrc-6.1.7.tar.gz -C src/cpp && rm -rf unrarsrc-6.1.7.tar.gz && husky install", | ||
"clean": "rm -rf dist coverage dist_map esm", | ||
@@ -31,16 +31,16 @@ "clean:test": "rm -rf dist/test dist/build esm/test esm/build", | ||
"devDependencies": { | ||
"@types/eslint": "^8.4.1", | ||
"@types/mocha": "^9.1.0", | ||
"@types/eslint": "^8.4.3", | ||
"@types/mocha": "^9.1.1", | ||
"@types/shelljs": "^0.8.11", | ||
"@typescript-eslint/eslint-plugin": "^5.12.0", | ||
"@typescript-eslint/parser": "^5.12.0", | ||
"eslint": "^8.9.0", | ||
"eslint-config-prettier": "^8.3.0", | ||
"@typescript-eslint/eslint-plugin": "^5.28.0", | ||
"@typescript-eslint/parser": "^5.28.0", | ||
"eslint": "^8.17.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"husky": "^7.0.4", | ||
"lint-staged": "^12.3.4", | ||
"mocha": "^9.2.0", | ||
"prettier": "^2.5.1", | ||
"husky": "^8.0.1", | ||
"lint-staged": "^13.0.1", | ||
"mocha": "^10.0.0", | ||
"prettier": "^2.7.0", | ||
"shelljs": "^0.8.5", | ||
"typescript": "^4.5.5" | ||
"typescript": "^4.7.3" | ||
}, | ||
@@ -47,0 +47,0 @@ "engines": { |
@@ -8,3 +8,3 @@ # node-unrar-js | ||
`node-unrar.js` is a npm module to extract rar archive in pure JavaScript. It's combined by a Javascript adoption layer and JavaScript unRar library compiled by [Emscripten](http://emscripten.org/) from the [C++ unrar library](http://www.rarlab.com/rar/unrarsrc-6.0.2.tar.gz) which hosted on http://www.rarlab.com/rar_add.htm . | ||
`node-unrar.js` is a npm module to extract rar archive in pure JavaScript. It's combined by a Javascript adoption layer and JavaScript unRar library compiled by [Emscripten](http://emscripten.org/) from the [C++ unrar library](http://www.rarlab.com/rar/unrarsrc-6.1.7.tar.gz) which hosted on <http://www.rarlab.com/rar_add.htm> . | ||
@@ -107,4 +107,3 @@ ## Installation | ||
- `fileHeader: FileHeader` : The header of the extracted file | ||
- `extraction: Uint8Array` : The extracted content of the file (`createExtractorFromData` only). | ||
- Note: Different to `getFileList`, only files will be parsed by this api, the folders will be skipped. | ||
- `extraction?: Uint8Array` : The extracted content of the file (`createExtractorFromData` only). If the `ArcFile` is a folder (`ArcFile.fileHeader.flags.directory` is `true`), the `extraction` will be undefined, otherwise it will be the content of the file (in `Uint8Array). | ||
@@ -235,2 +234,7 @@ ```js | ||
#### 2.0.0 (2022-06-15) | ||
- Add support for NodeJs v18 | ||
- **(Breaking change)**: `ArcFile.extraction` is optional for `createExtractorFromData` now. If `ArcFile.fileHeader.flags.directory` is `true`, this field will be `undefined`. | ||
#### 1.0.6 (2022-03-16) | ||
@@ -267,4 +271,4 @@ | ||
#### 0.8.0: | ||
#### 0.8.0 | ||
- First release |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
271
608353
35
1820