Package Exports
- archiver-zip-encryptable
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (archiver-zip-encryptable) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
archiver-zip-encryptable
An extension for archiver to zip with password encryption.
This extension adds some formats to handle encryption to archiver.
Currently this package supports only creating zip with traditional PKWARE encryption.
Install
npm install archiver-zip-encryptable --saveUsage
Call archiver.registerFormat() to register this module to archiver, then archive with password.
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 - password protected zip, Golang implementation
- .ZIP File Format Specification
License
MIT