File tree 4 files changed +25
-18
lines changed
4 files changed +25
-18
lines changed Original file line number Diff line number Diff line change 1
- # ADM-ZIP for NodeJS with added support for electron original-fs
1
+ # ADM-ZIP for NodeJS
2
2
3
3
ADM-ZIP is a pure JavaScript implementation for zip data compression for [ NodeJS] ( https://nodejs.org/ ) .
4
4
5
+ <a href =" https://github.com/cthackers/adm-zip/actions/workflows/ci.yml " >
6
+ <img src =" https://github.com/cthackers/adm-zip/actions/workflows/ci.yml/badge.svg " alt =" Build Status " >
7
+ </a >
8
+
5
9
# Installation
6
10
7
11
With [ npm] ( https://www.npmjs.com/ ) do:
8
12
9
13
$ npm install adm-zip
10
14
15
+ ** Electron** file system support described below.
16
+
11
17
## What is it good for?
12
18
13
19
The library allows you to:
@@ -63,4 +69,19 @@ zip.writeZip(/*target file name*/ "/home/me/files.zip");
63
69
64
70
For more detailed information please check out the [ wiki] ( https://github.com/cthackers/adm-zip/wiki ) .
65
71
66
- [ ![ Build Status] ( https://travis-ci.org/cthackers/adm-zip.svg?branch=master )] ( https://travis-ci.org/cthackers/adm-zip )
72
+ ## Electron original-fs
73
+
74
+ ADM-ZIP has supported electron ** original-fs** for years without any user interractions but it causes problem with bundlers like rollup etc. For continuing support ** original-fs** or any other custom file system module. There is possible specify your module by ** fs** option in ADM-ZIP constructor.
75
+
76
+ Example:
77
+
78
+ ``` javascript
79
+ const AdmZip = require (" adm-zip" );
80
+ const OriginalFs = require (" original-fs" );
81
+
82
+ // reading archives
83
+ const zip = new AdmZip (" ./my_file.zip" , { fs: OriginalFs });
84
+ .
85
+ .
86
+ .
87
+ ```
Original file line number Diff line number Diff line change 1
- const fs = require ( "./fileSystem" ) . require ( ) ;
2
1
const pth = require ( "path" ) ;
3
2
4
- fs . existsSync = fs . existsSync || pth . existsSync ;
5
-
6
- module . exports = function ( /*String*/ path ) {
3
+ module . exports = function ( /*String*/ path , /*Utils object*/ { fs } ) {
7
4
var _path = path || "" ,
8
5
_obj = newAttr ( ) ,
9
6
_stat = null ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1
- const fsystem = require ( "./fileSystem" ) . require ( ) ;
1
+ const fsystem = require ( "fs" ) ;
2
2
const pth = require ( "path" ) ;
3
3
const Constants = require ( "./constants" ) ;
4
4
const Errors = require ( "./errors" ) ;
You can’t perform that action at this time.
0 commit comments