aboutsummaryrefslogtreecommitdiff
path: root/lib/zipfile.js
diff options
context:
space:
mode:
Diffstat (limited to 'lib/zipfile.js')
-rw-r--r--lib/zipfile.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/zipfile.js b/lib/zipfile.js
index 2c004b7..eb6bf66 100644
--- a/lib/zipfile.js
+++ b/lib/zipfile.js
@@ -19,9 +19,20 @@ function openArrayBuffer(arrayBuffer) {
return promises.when(buffer);
}
}
+
+ function write(name, contents) {
+ zipFile.file(name, contents);
+ }
+
+ function toBuffer() {
+ return zipFile.generate({type: "nodebuffer"});
+ }
+
return {
exists: exists,
- read: read
+ read: read,
+ write: write,
+ toBuffer: toBuffer
};
}