@calipsa/tar

Buffers to TAR

Usage no npm install needed!

<script type="module">
  import calipsaTar from 'https://cdn.skypack.dev/@calipsa/tar';
</script>

README

@calipsa/tar

NPM version Downloads Dependency status Dev Dependency status

A tool to convert buffers or strings to a TAR stream

Installation

# using npm:
npm install --save @calipsa/tar

# or if you like yarn:
yarn add @calipsa/tar

Usage

const toTar = require('@calipsa/tar')

const data = [
  [
    {
      name: 'foo.txt',
    },
    Buffer.from('foo', 'utf8')
  ],
  [
    {
      name: 'bar/qux.txt',
      mode: 0o644,
    },
    Buffer.from('random string', 'utf8')
  ],
]

const tar = toTar(data) // stream.Readable