0.0.3 • Published 3 years ago

@endodata/zpaq-node-wrapper v0.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

zpaq-node-wrapper

A very basic nodejs wrapper around the zpaq cli.

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

Documentation

zpaqBinPath

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

listVersions(basePath, archivePath) ⇒ Promsise.<Array.<string>>

Lists all versions of an archive

Returns: Promsise.<Array.<string>> - The archive versions formated as YYYY-MM-DD HH:mm:SS strings (UTC)

ParamTypeDescription
basePathstringThe path form which the zpaq command is executed. All files added with relative paths must be relative to this directory.
archivePathstringThe path to the zpaq archive

addFile(basePath, archivePath, relativeFilePath) ⇒ Promise.<execa.ExecaReturnBase>

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

Returns: Promise.<execa.ExecaReturnBase> - The execa process

ParamTypeDescription
basePathstringThe path form which the zpaq command is executed. All files added with relative paths must be relative to this directory.
archivePathstringThe path to the zpaq archive
relativeFilePathstringThe path to the file or directory to add to the archive. If relative, this path must be relative to basePath

extractUntil(basePath, archivePath, versionDate) ⇒ Promise.<execa.ExecaReturnBase>

Extract an archive until a given date.

Returns: Promise.<execa.ExecaReturnBase> - The execa process

ParamTypeDescription
basePathstringThe path form which the zpaq command is executed. All files added with relative paths must be relative to this directory.
archivePathstringThe path to the zpaq archive
versionDatestringThe 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

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

For 32bit

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

macOS

Simply use the makefile :

cd zpaq;
make
0.0.3

3 years ago

0.0.2

3 years ago