npm.io
0.0.3 • Published 4 years ago

@endodata/zpaq-node-wrapper

Licence
MIT
Version
0.0.3
Deps
2
Size
3.1 MB
Vulns
0
Weekly
0

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

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

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

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

Extract an archive until a given date.

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)

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

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

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

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

Keywords