tarts

2.0.1 • Public • Published

🥧 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)

Package Sidebar

Install

npm i tarts

Weekly Downloads

477

Version

2.0.1

License

WTFPL

Unpacked Size

7.2 kB

Total Files

5

Last publish

Collaborators

  • porsager