just-zip
Just Zip both files and directories with ease
Last updated 5 years ago by polomoshnov .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install just-zip 
SYNC missed versions from official npm registry.

Just Zip

by Alexander Polomoshnov

released under the MIT license

Just Zip both files and directories with ease.

Install

npm install just-zip

Examples

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)
})

Acknowledgment

Just Zip is built upon node-archiver.

Current Tags

  • 0.0.2                                ...           latest (5 years ago)

1 Versions

  • 0.0.2                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (1)

Copyright 2014 - 2016 © taobao.org |