Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ been saved to disk.
* `saveTo` A path to save the buffer to.
* `filter` A function that is called for all items to determine whether or not they should be added to the zip buffer. Function is called with the `fullPath` and a `stats` object ([fs.Stats](http://nodejs.org/api/fs.html#fs_class_fs_stats)). Return true to add the item; false otherwise. To include files within directories, directories must also pass this filter.
* `each` A function that is called everytime a file or directory is added to the zip.
* `comment` A comment to be stored to the zip file.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there more documentation for what a comment is in this context?

* `compressionLevel` The level of compression to use. A number from 1 (best speed) and 9 (best compression). 6 is the default.

## TODO

Expand Down
6 changes: 5 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,11 @@ function zipBuffer (rootDir, options, callback) {

callback(null, zip.generate({
compression: 'DEFLATE',
type: 'nodebuffer'
type: 'nodebuffer',
comment: options.comment,
compressionOptions: {
level: options.compressionLevel
}
}));
});

Expand Down