How to use the adm-zip/zipEntry.js function in adm-zip

To help you get started, we’ve selected a few adm-zip examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github imlucas / lone / embed / admzip.js View on Github external
function readEntries() {
                entryTable = {};
                entryList = new Array(mainHeader.diskEntries);
                var index = mainHeader.offset;
                for (var i = 0; i < entryList.length; i++) {
                    var tmp = index, entry = new ZipEntry(inBuffer);
                    entry.header = inBuffer.slice(tmp, tmp += Utils.Constants.CENHDR);
                    entry.entryName = inBuffer.slice(tmp, tmp += entry.header.fileNameLength);
                    if (entry.header.extraLength) {
                        entry.extra = inBuffer.slice(tmp, tmp += entry.header.extraLength);
                    }
                    if (entry.header.commentLength) entry.comment = inBuffer.slice(tmp, tmp + entry.header.commentLength);
                    index += entry.header.entryHeaderSize;
                    entryList[i] = entry;
                    entryTable[entry.entryName] = entry;
                }
            }
            function readMainHeader() {
github imlucas / lone / embed / admzip.js View on Github external
addFile: function(entryName, content, comment, attr) {
                    var entry = new ZipEntry;
                    entry.entryName = entryName;
                    entry.comment = comment || "";
                    entry.attr = attr || 438;
                    if (entry.isDirectory && content.length) {}
                    entry.setData(content);
                    _zip.setEntry(entry);
                },
                getEntries: function() {