I can't find my mistake. It worked a few month ago. But now it returns an empty zip file. Also, it is not password secured. The name of the generated zip file is correct. Happy for some help.
var fs = require('fs');
var Minizip = require('minizip-asm.js');
var text = new Buffer.from("Abc~~~");
var mz = new Minizip();
mz.append("../data/mysqlDump.sql", text, {password: '1111'});
let zipfile= "../data/mysqlDump.zip";
fs.writeFileSync(zipfile, new Buffer.from(mz.zip()));
EDIT:
I am using now node.js jszip. It works fine. But is there a simple way to protect a zipfile with a password? Because this feature is not included with jszip. I have a linux platform. Is there a way to protect a zip file with a password?