bua
Backup archive, as a tar alternative.
Installation
npm i bua
Header
bua's format is relatively simple, header contains the following:
Header | Optional | Value | Description |
---|---|---|---|
name | false |
string |
Basically relative path of this directory or file |
size | false |
number |
Size in bytes of this file, directory is 0 |
mtime | true |
number |
Last modified time in ms |
mode | true |
number |
File mode, usually permission |
type | false |
file | directory | Type is either file or directory |
Usage
bua uses stream on both packing and extracting, it is the most efficient way to transform and transmit data. Also allow you to pipe bua stream to fs
, cipher
, socket
, etc. easily.
Pack
Here is a simple example of packing node_modules
to a single .bua
file.
;; const pack = ; ; //pipe output stream to a fs writeStreampackoutput; { fs;}
Extract
Extract a .bua
file to file system with original folder structure.
extract = ; // callback on entry foundextract; //pipe fs readStream to input streamfs;