zstream v0.3.1 Zstream View Source

Module for creating ZIP file stream

Example

Zstream.zip([
  Zstream.entry("report.csv", Stream.map(records, &CSV.dump/1)),
  Zstream.entry("catfilm.mp4", File.stream!("/catfilm.mp4"), coder: Zstream.Coder.Stored)
])
|> Stream.into(File.stream!("/archive.zip"))
|> Stream.run

Link to this section Summary

Functions

Creates a ZIP file entry with the given name

Creates a ZIP file stream

Link to this section Types

Link to this section Functions

Link to this function

entry(name, enum, options \\ [])

View Source
entry(String.t(), Enumerable.t(), Keyword.t()) :: entry()

Creates a ZIP file entry with the given name

The enum could be either lazy Stream or List. The elements in enum should be of type iodata

Options

Creates a ZIP file stream

entries are consumed one by one in the given order