Liking cljdoc? Tell your friends :D

:file_folder: clompress

Clojars Project

Clompress is easy to use library for working with archives, compression and decompression in Clojure. Currently acts like wrapper for library Apache Commons Compress


Directories are readed recursively.

Supported archives

  • [x] TAR "tar"
  • [x] ZIP "zip"

Supported compressions

  • [x] BZIP2
  • [x] GZIP
  • [x] DEFLATE
  • [x] LZ4 (BLOCK, FRAMED)
  • [x] LZMA
  • [x] XZ

For available compressions:




[com.monkeyprojects/clompress "0.1.0"]

Clojure CLI/deps.edn

com.monkeyprojects/clompress {:mvn/version "0.1.0"}


Creating archive without compression

(clompress/archive {
	:output-stream ( "my-archive.tar")
	:archive-type "tar"} ; for zip set :archive-type "zip"
	"directory1/" "directory2/file1.txt" "file2.txt")

Creating archive with compression bzip2

(clompress/archive {
	:output-stream ( "my-archive.tar.bz2")
	:compression "bzip2"
	:archive-type "tar"}
	"directory1/" "directory2/file1.txt" "file2.txt")

Compressing file

	( "file-to-compress.txt")
	( "compressed-file.txt.gz")

Decompressing file

	( "compressed-file.txt.gz")
	( "decompressed-file.txt")

Compressing string

(with-open [input-stream (
                           (.getBytes "test-data"))]
  (with-open [output-stream (]
    (clompress.compression/compress input-stream output-stream "bzip2")))

Decompressing string

(with-open [input-stream (
                           (.getBytes compressed-string))]
  (with-open [output-stream (]
    (clompress.compression/decompress input-stream output-stream "bzip2")
		(.toString output-stream)))


Clompress is licensed under MIT license.

Can you improve this documentation? These fine people already did:
Spelchure & Wout Neirynck
Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close