Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
write out original-fs
  • Loading branch information
5saviahv committed Jun 9, 2024
commit b7d48a0fa3314d7235bd740197503058cc42f25f
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
# ADM-ZIP for NodeJS with added support for electron original-fs
# ADM-ZIP for NodeJS

ADM-ZIP is a pure JavaScript implementation for zip data compression for [NodeJS](https://nodejs.org/).

<a href="https://github.com/cthackers/adm-zip/actions/workflows/ci.yml">
<img src="https://github.com/cthackers/adm-zip/actions/workflows/ci.yml/badge.svg" alt="Build Status">
</a>

# Installation

With [npm](https://www.npmjs.com/) do:

$ npm install adm-zip

**Electron** file system support described below.

## What is it good for?

The library allows you to:
Expand Down Expand Up @@ -63,4 +69,19 @@ zip.writeZip(/*target file name*/ "/home/me/files.zip");

For more detailed information please check out the [wiki](https://github.com/cthackers/adm-zip/wiki).

[![Build Status](https://travis-ci.org/cthackers/adm-zip.svg?branch=master)](https://travis-ci.org/cthackers/adm-zip)
## Electron original-fs

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.

Example:

```javascript
const AdmZip = require("adm-zip");
const OriginalFs = require("original-fs");

// reading archives
const zip = new AdmZip("./my_file.zip", { fs: OriginalFs });
.
.
.
```
11 changes: 0 additions & 11 deletions util/fileSystem.js

This file was deleted.

2 changes: 1 addition & 1 deletion util/utils.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const fsystem = require("./fileSystem").require();
const fsystem = require("fs");
const pth = require("path");
const Constants = require("./constants");
const Errors = require("./errors");
Expand Down