gzip / gunzip / bunzip support

  
      const compressors = require('@unitybase/compressors');
const UZip = compressors.UZip
const uZip = new UZip('/some/file.zip')
uZip
  .remove('file1251.txt')
  .remove('file866.txt')
  .file('newFile.txt', 'String file content', { type: 'string' })
  .file('folder/fromBuf.txt', Buffer.from('String file content').toString('base64'), { base64: true })
  .file('os-release.txt', '/etc/os-release', {isFilename: true})
  .generate({
    type: 'file',
    filename: '/tmp/newArch.zip'
  })
const readZ = new UZip('/tmp/newArch.zip')
const osVersion = readZ.file('os-release.txt').asText()
  

Classes

Methods

# gunzipFile (fileNameFromString, fileNameToString) inner

Decompress file using gzip algorithm

Arguments:

# gzipFile (fileNameFromString, fileNameToString) inner

Compress file using gzip algorithm

Arguments:

# unBzipM2 (bufferArrayBuffer) → ArrayBuffer inner

Decompress files from Megapolis2(TM) bzip format(first 4 bytes are length of uncompressed files)

Arguments: