# @itk-wasm/dam

> Data Archive Manager

Latest version **1.1.1** (published 2024-02-02) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @itk-wasm/dam
pnpm add @itk-wasm/dam
yarn add @itk-wasm/dam
bun add @itk-wasm/dam
```

Provides the command `dam`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2024-02-02 |
| First published | 2023-05-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 6 |
| Unpacked size | 114.2 KB |
| Known vulnerabilities | 0 (+15 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Matt McCormick |
| Maintainers | paulhax, thewtex |
| Keywords | data, testing, examples |

## Links

- npm: https://www.npmjs.com/package/@itk-wasm/dam
- Repository: https://github.com/InsightSoftwareConsortium/dam
- Homepage: https://github.com/InsightSoftwareConsortium/dam#readme
- Issues: https://github.com/InsightSoftwareConsortium/dam/issues
- npm.io page: https://npm.io/package/@itk-wasm/dam

## Dependencies (6)

- [tar](https://npm.io/package/tar.md) ^6.1.13
- [axios](https://npm.io/package/axios.md) ^1.4.0
- [ipfs-car](https://npm.io/package/ipfs-car.md) ^1.0.0
- [commander](https://npm.io/package/commander.md) ^10.0.1
- [decompress](https://npm.io/package/decompress.md) ^4.2.1
- [files-from-path](https://npm.io/package/files-from-path.md) ^1.0.0

## Alternatives

- [duck](https://npm.io/package/duck.md) — 4.2M weekly downloads
- [ava](https://npm.io/package/ava.md) — 560.2K weekly downloads
- [storybook-addon-module-mock](https://npm.io/package/storybook-addon-module-mock.md) — 71.7K weekly downloads
- [vest](https://npm.io/package/vest.md) — 50.1K weekly downloads
- [@ethereum-waffle/mock-contract](https://npm.io/package/@ethereum-waffle/mock-contract.md) — 40.0K weekly downloads

## Recent versions

- 1.1.1 (latest) — 2024-02-02
- 1.1.0 — 2023-12-06
- 1.0.1 — 2023-05-04
- 1.0.0 — 2023-05-03

## README

# @itk-wasm/dam

Data Archive Manager (dam): a tool to prepare and download source code repository testing, example, and website asset data.

Data is stored in .tar.gz archives and can be hosted at multiple, redundant https URLs. A simpler, more flexible alternative to Git LFS, etc.

## Features

- Download and unpack testing and example data .tar.gz archives
- CLI for NPM scripts
- Verify with an expected hash compatible with web3.storage
- Cache archive downloads based on the expected hash
- Support for multiple storage urls
- Automatic retries

## Installation

```sh
npm install -g @itk-wasm/dam
```

## Usage

Store your data in a directory. For example:

```sh
> mkdir -p test/data
> touch test/data/file1.txt
> touch test/data/file2.txt
```

Pack the current version of the data into a compressed archive:

```sh
> dam pack test/data test/data.tar.gz
CID: bafkreibetv3747ysuplkqkwlomeaao3nk3uak7wtzgrgmrtvmah5jdyawy
```

Upload the *test/data.tar.gz* file to hosting services such as [web3.storage](https://web3.storage), GitHub Releases, AWS s3, a local http server, etc. For web3.storage, upload with the [`w3`](https://github.com/web3-storage/web3.storage) CLI:

```
> npm install --global @web3-storage/w3
> w3 token
> w3 put --name dam-test-data --no-wrap test/data.tar.gz
# Packed 1 file (0.0MB)
# bafkreibetv3747ysuplkqkwlomeaao3nk3uak7wtzgrgmrtvmah5jdyawy
⁂ Stored 1 file
⁂ https://w3s.link/ipfs/bafkreibetv3747ysuplkqkwlomeaao3nk3uak7wtzgrgmrtvmah5jdyawy
```

Note the `--no-wrap` flag.

In your NPM scripts, add

```sh
> dam download -v test/data test/data.tar.gz bafkreibetv3747ysuplkqkwlomeaao3nk3uak7wtzgrgmrtvmah5jdyawy https://w3s.link/ipfs/bafkreibetv3747ysuplkqkwlomeaao3nk3uak7wtzgrgmrtvmah5jdyawy
```

If the data is stored at multiple locations, add all URLs to the end of the `download` subcommand.

The first time this command is called the data will be downloaded and unpacked.

When data updates are required, repeat the pack / upload process, and update the content identifer (CID) hash.

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