How to use the adm-zip/util/index.js.toBuffer 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
set entryName(val) {
                    _entryName = Utils.toBuffer(val);
                    var lastChar = _entryName[_entryName.length - 1];
                    _isDirectory = lastChar == 47 || lastChar == 92;
                    _entryHeader.fileNameLength = _entryName.length;
                },
                get extra() {
github imlucas / lone / embed / admzip.js View on Github external
set comment(val) {
                    _comment = Utils.toBuffer(val);
                    _entryHeader.commentLength = _comment.length;
                },
                get name() {
github imlucas / lone / embed / admzip.js View on Github external
setData: function(value) {
                    uncompressedData = Utils.toBuffer(value);
                    if (!_isDirectory && uncompressedData.length) {
                        _entryHeader.size = uncompressedData.length;
                        _entryHeader.method = Utils.Constants.DEFLATED;
                        _entryHeader.crc = Utils.crc32(value);
                    } else {
                        _entryHeader.method = Utils.Constants.STORED;
                    }
                },
                getData: function() {