zip = require('just-zip')
filePath = 'C:\\Users\\Polomoshnov\\test.pdf'
filePath2 = '../lorem ipsum.txt'
dirPath = '../pdfs'
customZipFilePath = 'C:\\Users\\Polomoshnov\\files.zip'
zip(filePath, function (err, zipFilePath) {
if (err) return console.error('Failed to zip:', err)
console.log('Zipped one file into', zipFilePath)
})
zip([filePath, filePath2], function (err, zipFilePath) {
if (err) return console.error('Failed to zip:', err)
console.log('Zipped two files into', zipFilePath)
})
zip([filePath, filePath2, dirPath], function (err, zipFilePath) {
if (err) return console.error('Failed to zip:', err)
console.log('Zipped two files and one directory into', zipFilePath)
})
zip([filePath, filePath2, dirPath], customZipFilePath, function (err, zipFilePath) {
if (err) return console.error('Failed to zip:', err)
console.log('Zipped two files and one directory into', zipFilePath)
})