diff --git a/README.md b/README.md index 398087b..428e77d 100644 --- a/README.md +++ b/README.md @@ -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. +* `compressionLevel` The level of compression to use. A number from 1 (best speed) and 9 (best compression). 6 is the default. ## TODO diff --git a/index.js b/index.js index 3fa84a0..c29c178 100644 --- a/index.js +++ b/index.js @@ -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 + } })); });