https://github.com/porsager/tarts
Create tarballs in node or the browser
https://github.com/porsager/tarts
archive browser node tar tarball zip
Last synced: 3 months ago
JSON representation
Create tarballs in node or the browser
- Host: GitHub
- URL: https://github.com/porsager/tarts
- Owner: porsager
- Created: 2017-12-05T14:24:44.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2022-03-31T10:45:33.000Z (over 3 years ago)
- Last Synced: 2025-06-16T23:36:41.598Z (4 months ago)
- Topics: archive, browser, node, tar, tarball, zip
- Language: JavaScript
- Size: 44.9 KB
- Stars: 10
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
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: 'Hello world
'
}])
```### 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)
```