JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2654
  • Score
    100M100P100Q115105F
  • License WTFPL

Create tarballs in node or the browser

Package Exports

  • tarts

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (tarts) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

🥧 Tarts

Create tarballs in node or the browser. Tarts is a simple function that takes an array of files and returns a tarball as a Uint8Array.

Creating a tarball

const tar = Tar([{
  name: 'index.html',
  content: '<!doctype html><h1>Hello world</h1>'
}])

Download tarball in browser

const tar = Tar(...)

const a = document.createElement('a')
a.href = URL.createObjectURL(new Blob([tar], { type: 'application/tar' }))
a.download = 'filename.tar'
a.click()

Save to disk in node

const tar = Tar(...)
fs.writeFileSync('my.tar', tar)