Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/feross/cross-zip
Cross-platform .zip file creation
https://github.com/feross/cross-zip
create-zip-file cross-zip file javascript nodejs zip zip-file
Last synced: 3 days ago
JSON representation
Cross-platform .zip file creation
- Host: GitHub
- URL: https://github.com/feross/cross-zip
- Owner: feross
- License: mit
- Created: 2016-04-16T06:51:42.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2024-02-12T03:39:20.000Z (11 months ago)
- Last Synced: 2024-05-23T07:19:38.375Z (7 months ago)
- Topics: create-zip-file, cross-zip, file, javascript, nodejs, zip, zip-file
- Language: JavaScript
- Homepage:
- Size: 41 KB
- Stars: 126
- Watchers: 4
- Forks: 25
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# cross-zip [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]
[ci-image]: https://img.shields.io/github/workflow/status/feross/cross-zip/ci/master
[ci-url]: https://github.com/feross/cross-zip/actions
[npm-image]: https://img.shields.io/npm/v/cross-zip.svg
[npm-url]: https://npmjs.org/package/cross-zip
[downloads-image]: https://img.shields.io/npm/dm/cross-zip.svg
[downloads-url]: https://npmjs.org/package/cross-zip
[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg
[standard-url]: https://standardjs.com### Cross-platform .zip file creation
## install
```
npm install cross-zip
```## usage
```js
var zip = require('cross-zip')var inPath = path.join(__dirname, 'myFolder') // folder to zip
var outPath = path.join(__dirname, 'myFile.zip') // name of output zip filezip.zipSync(inPath, outPath)
```## api
### `zip.zip(inPath, outPath, [callback])`
Zip the folder at `inPath` and save it to a .zip file at `outPath`. If a `callback`
is passed, then it is called with an `Error` or `null`.### `zip.zipSync(inPath, outPath)`
Sync version of `zip.zip`.
### `zip.unzip(inPath, outPath, [callback])`
Unzip the .zip file at `inPath` into the folder at `outPath`. If a `callback` is
passed, then it is called with an `Error` or `null`.### `zip.unzipSync(inPath, outPath)`
Sync version of `zip.unzip`.
## Windows users
This package requires [.NET Framework 4.5 or later](https://www.microsoft.com/net)
and [Powershell 3](https://www.microsoft.com/en-us/download/details.aspx?id=34595).
These come **pre-installed** on Windows 8 or later.On Windows 7 or earlier, you will need to install these manually in order for
`cross-zip` to function correctly.## reference
- [Stack Overflow - zipping from command line in Windows](https://stackoverflow.com/questions/17546016/how-can-you-zip-or-unzip-from-the-command-prompt-using-only-windows-built-in-ca)
## related
- [cross-zip-cli](https://github.com/jprichardson/cross-zip-cli): CLI version of cross-zip.
## license
MIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).