https://github.com/ksoichiro/node-archiver-zip-encryptable
An extension for archiver to zip with password encryption.
https://github.com/ksoichiro/node-archiver-zip-encryptable
archiver nodejs password-encryption zip
Last synced: about 1 year ago
JSON representation
An extension for archiver to zip with password encryption.
- Host: GitHub
- URL: https://github.com/ksoichiro/node-archiver-zip-encryptable
- Owner: ksoichiro
- License: mit
- Created: 2018-11-25T15:41:47.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-04T02:59:46.000Z (over 3 years ago)
- Last Synced: 2025-03-21T15:52:27.431Z (over 1 year ago)
- Topics: archiver, nodejs, password-encryption, zip
- Language: JavaScript
- Size: 861 KB
- Stars: 12
- Watchers: 2
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# archiver-zip-encryptable
> An extension for archiver to zip with password encryption.
[](https://travis-ci.org/ksoichiro/node-archiver-zip-encryptable)
[](https://ci.appveyor.com/project/ksoichiro/node-archiver-zip-encryptable)
[](https://coveralls.io/github/ksoichiro/node-archiver-zip-encryptable)
[](https://www.npmjs.com/package/archiver-zip-encryptable)
[](https://github.com/ksoichiro/node-archiver-zip-encryptable/blob/master/LICENSE)
This extension adds some formats to handle encryption to [archiver](https://github.com/archiverjs/node-archiver).
Currently this package supports only creating zip with traditional PKWARE encryption.
## Install
```sh
npm install archiver-zip-encryptable --save
```
## Usage
Call `archiver.registerFormat()` to register this module to `archiver`, then archive with password.
```js
var fs = require('fs');
var archiver = require('archiver');
archiver.registerFormat('zip-encryptable', require('archiver-zip-encryptable'));
var output = fs.createWriteStream(__dirname + '/example.zip');
var archive = archiver('zip-encryptable', {
zlib: { level: 9 },
forceLocalTime: true,
password: 'test'
});
archive.pipe(output);
archive.append(Buffer.from('Hello World'), { name: 'test.txt' });
archive.append(Buffer.from('Good Bye'), { name: 'test2.txt' });
archive.finalize();
```
## Credits
- [yeka/zip](https://github.com/yeka/zip) - password protected zip, Golang implementation
- [.ZIP File Format Specification](https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT)
## License
MIT