# @endodata/zpaq-node-wrapper

> A very basic nodejs wrapper around the zpaq cli

Latest version **0.0.3** (published 2021-10-28) · MIT license · 0 weekly downloads

## Install

```sh
npm install @endodata/zpaq-node-wrapper
pnpm add @endodata/zpaq-node-wrapper
yarn add @endodata/zpaq-node-wrapper
bun add @endodata/zpaq-node-wrapper
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2021-10-28 |
| First published | 2021-10-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 3.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Jeremy Dahan |
| Maintainers | jeremydahan |
| Keywords | zpaq, backup, archive |

## Links

- npm: https://www.npmjs.com/package/@endodata/zpaq-node-wrapper
- Repository: https://github.com/EndoData/zpaq-node-wrapper
- Homepage: https://github.com/EndoData/zpaq-node-wrapper#readme
- Issues: https://github.com/EndoData/zpaq-node-wrapper/issues
- npm.io page: https://npm.io/package/@endodata/zpaq-node-wrapper

## Dependencies (2)

- [path](https://npm.io/package/path.md) ^0.12.7
- [execa](https://npm.io/package/execa.md) ^4.0.0

## 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

- 0.0.3 (latest) — 2021-10-28
- 0.0.2 — 2021-10-28

## README

# zpaq-node-wrapper

A very basic nodejs wrapper around the [zpaq cli](https://github.com/zpaq/zpaq).

Using zpaq 7.15 as a base, I also added an option to list all versions using 'v'.

## Documentation

<dl>
<dt><a href="#zpaqBinPath">zpaqBinPath</a></dt>
<dd><p>The path to the binary executable for zpaq. Works in electron environments. Works with macOS and windows.</p>
</dd>
</dl>

<dl>
<dt><a href="#listVersions">listVersions(basePath, archivePath)</a> ⇒ <code>Promsise.&lt;Array.&lt;string&gt;&gt;</code></dt>
<dd><p>Lists all versions of an archive</p>
</dd>
<dt><a href="#addFile">addFile(basePath, archivePath, relativeFilePath)</a> ⇒ <code>Promise.&lt;execa.ExecaReturnBase&gt;</code></dt>
<dd><p>Adds a relative or absolute file or directory to an archive.</p>
</dd>
<dt><a href="#extractUntil">extractUntil(basePath, archivePath, versionDate)</a> ⇒ <code>Promise.&lt;execa.ExecaReturnBase&gt;</code></dt>
<dd><p>Extract an archive until a given date.</p>
</dd>
</dl>

<a name="zpaqBinPath"></a>

### zpaqBinPath

The path to the binary executable for zpaq. Works in electron environments. Works with macOS and windows.

<a name="listVersions"></a>

### listVersions(basePath, archivePath) ⇒ <code>Promsise.&lt;Array.&lt;string&gt;&gt;</code>

Lists all versions of an archive

**Returns**: <code>Promsise.&lt;Array.&lt;string&gt;&gt;</code> - The archive versions formated as `YYYY-MM-DD HH:mm:SS` strings (UTC)

| Param       | Type                | Description                                                                                                               |
| ----------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| basePath    | <code>string</code> | The path form which the zpaq command is executed. All files added with relative paths must be relative to this directory. |
| archivePath | <code>string</code> | The path to the zpaq archive                                                                                              |

<a name="addFile"></a>

### addFile(basePath, archivePath, relativeFilePath) ⇒ <code>Promise.&lt;execa.ExecaReturnBase&gt;</code>

Adds a relative or absolute file or directory to an archive.

**Returns**: <code>Promise.&lt;execa.ExecaReturnBase&gt;</code> - The execa process

| Param            | Type                | Description                                                                                                               |
| ---------------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| basePath         | <code>string</code> | The path form which the zpaq command is executed. All files added with relative paths must be relative to this directory. |
| archivePath      | <code>string</code> | The path to the zpaq archive                                                                                              |
| relativeFilePath | <code>string</code> | The path to the file or directory to add to the archive. If relative, this path must be relative to basePath              |

<a name="extractUntil"></a>

### extractUntil(basePath, archivePath, versionDate) ⇒ <code>Promise.&lt;execa.ExecaReturnBase&gt;</code>

Extract an archive until a given date.

**Returns**: <code>Promise.&lt;execa.ExecaReturnBase&gt;</code> - The execa process

| Param       | Type                | Description                                                                                                               |
| ----------- | ------------------- | ------------------------------------------------------------------------------------------------------------------------- |
| basePath    | <code>string</code> | The path form which the zpaq command is executed. All files added with relative paths must be relative to this directory. |
| archivePath | <code>string</code> | The path to the zpaq archive                                                                                              |
| versionDate | <code>string</code> | The date until which to extract the archive (UTC)                                                                         |

## To Compile

Refer to https://github.com/zpaq/zpaq

### Windows

Use http://files.1f0.de/mingw/mingw-w64-gcc-6.1-stable-r20.7z
Use the compiler binaries in bin/

For 64bit

```bash
86_64-w64-mingw32-g++.exe -O3 -s -m64 -msse2 -static zpaq.cpp libzpaq.cpp -o zpaq64
```

For 32bit

```bash
i686-w64-mingw32-g++.exe -O3 -s -m32 -msse2 -static zpaq.cpp libzpaq.cpp -o zpaq
```

### macOS

Simply use the makefile :

```bash
cd zpaq;
make
```

---
_Source: https://npm.io/package/@endodata/zpaq-node-wrapper · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
