tartiflette
gleam add tartiflette@1Tartiflette is a simple, pure Gleam implementation of a tarball extractor. It primarily exists to support tarball extraction in the browser, without relying on npm packages or a bundler. For server-side applications, it is strongly recommended to reach for a more-robust solution such as star instead.
Usage
let tarball = <<...>> // A BitArray representing a valid tar archive.
let assert Ok(entries) = tartiflette.extract(tarball)
list.each(entries, fn(entry) {
case entry {
tartiflette.File(name:, ..) ->
io.println("File: " <> name)
HardLink(name:, target:) ->
io.println("Hard link: " <> name <> " -> " <> target)
SymbolicLink(name:, target:) ->
io.println("Symbolic link: " <> name <> " -> " <> target)
CharacterDevice(name:, ..) ->
io.println("Character device: " <> name)
BlockDevice(name:, ..) ->
io.println("Block device: " <> name)
Directory(name:) ->
io.println("Directory: " <> name)
Fifo(name:) ->
io.println("FIFO: " <> name)
}
})Contributing
This package was written to solve a specific problem I had, and as such features and fixes outside of my immediate needs are unlikely to be implemented by me. Pull requests are very welcome but please do not open feature requests or bug reports unless you are prepared to implement them yourself 💕.