# tilelive-tar

> A tar sink for tilelive

Latest version **1.1.0** (published 2018-04-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install tilelive-tar
pnpm add tilelive-tar
yarn add tilelive-tar
bun add tilelive-tar
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2018-04-27 |
| First published | 2018-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Karissa McKelvey |
| Maintainers | karissa |
| Keywords | tar, tilelive |

## Links

- npm: https://www.npmjs.com/package/tilelive-tar
- Repository: https://github.com/karissa/tilelive-tar
- Homepage: https://github.com/karissa/tilelive-tar#readme
- Issues: https://github.com/karissa/tilelive-tar/issues
- npm.io page: https://npm.io/package/tilelive-tar

## Dependencies (1)

- [tar-stream](https://npm.io/package/tar-stream.md) ^1.5.5

## Alternatives

- [lodash.startswith](https://npm.io/package/lodash.startswith.md) — 769.7K weekly downloads
- [@tarojs/service](https://npm.io/package/@tarojs/service.md) — 33.9K weekly downloads
- [io.extendreality.tilia.indicators.spatialtargets.unity](https://npm.io/package/io.extendreality.tilia.indicators.spatialtargets.unity.md) — 131 weekly downloads
- [@rtarojs/taro](https://npm.io/package/@rtarojs/taro.md) — 90 weekly downloads
- [node-branch-io](https://npm.io/package/node-branch-io.md) — 50 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2018-04-27
- 1.0.1 — 2018-04-20
- 1.0.0 — 2018-04-20

## README

# tilelive-tar

A tar sink for tilelive that is browser-compatible. 

```
npm install tilelive-tar
```

Provide `tar://<dir>.<ext>` to download and pack all the tiles in the tar under the given directory. Files will be saved according to the provided extension name.

## Usage

```js
var tilelive = require('tilelive')
var TarBackend = require('tilelive-tar')
TarBackend.registerProtocols(tilelive)

tilelive.load('somewhere://path/to/some/tiles', function (err, source) {
  if (err) throw err
  tilelive.load('tar://tiles.png', function (err, sink) {
    if (err) throw err
    var readStream = source.createReadStream({minzoom, maxzoom, bounds})
    var writeStream = sink.createWriteStream()
    readStream.pipe(writeStream)
    .on('error', console.error)
    .on('end', function () {
      // sink.pack is the finalized tar file 
      // as a streams2 read stream that can be piped anywhere
      sink.pack.pipe(process.stdout)
    })
  })
})
```

## In Browser

See an example of using tilelive-tar with StreamSaver.js to download tiles without touching the server, at [karissa/tile-download-ui](https://github.com/karissa/tile-download-ui).

## License

MIT

---
_Source: https://npm.io/package/tilelive-tar · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
