1.0.37 • Published 10 months ago
7zip-bin-wrapper v1.0.37
7zip-bin-wrapper
Wrapper script for 7zip-bin
Parsing output from 7za, create progress event.
Params used by this package: (not able to use your self)
- -bs??
- -y
Progress created from 7za output line:
/^(\d+[%M])(?: - )?(.*)$/
Data Define:
interface IStatusReport {
progress: number; // 0 ~ 100
message: string;
}
interface TheHandler {
on(event: 'progress', cb: (progress: IStatusReport) => void): this;
on(event: 'output', cb: (data: string) => void): this;
/** by default, 7z will run at nextTick, but you can use hold() to prevent it */
hold(): void;
/** terminate 7z process */
cancel(): Promise<void>;
/** command line to run */
readonly commandline: ReadonlyArray<string>;
/** 7z's cwd */
readonly cwd: string;
/** wait process complete */
promise(): Promise<void>;
}
Usage:
import { sevenZip, sevenZipCli, extract, compress } from '7zip-bin-wrapper';
let handler: TheHandler;
// run raw command
handler = sevenZip('x', 'xxx.7z');
// run raw command, with spawn Option
handler = sevenZip({ cwd: '/tmp' }, 'x', 'xxx.7z');
// prevent add -y to 7za, and inherit stdin
handler = sevenZipCli('x', 'xxx.7z');
handler = extract('xxx.7z', 'some/where/else');
handler = compress('xxx.7z', 'to/include/', 'another/include/');
1.0.37
10 months ago
1.0.36
10 months ago
1.0.35
10 months ago
1.0.33
2 years ago
1.0.32
2 years ago
1.0.31
2 years ago
1.0.34
2 years ago
1.0.29
3 years ago
1.0.30
3 years ago
1.0.28
3 years ago
1.0.26
3 years ago
1.0.25
3 years ago
1.0.24
3 years ago
1.0.27
3 years ago
1.0.23
3 years ago
1.0.22
4 years ago
1.0.21
4 years ago
1.0.20
4 years ago
1.0.19
4 years ago
1.0.18
4 years ago
1.0.17
5 years ago
1.0.16
5 years ago
1.0.15
5 years ago
1.0.14
5 years ago
1.0.13
5 years ago
1.0.12
5 years ago
1.0.11
5 years ago
1.0.10
6 years ago
1.0.9
6 years ago
1.0.8
6 years ago
1.0.7
6 years ago
1.0.6
6 years ago
1.0.5
6 years ago
1.0.4
7 years ago
1.0.3
7 years ago
1.0.2
7 years ago
1.0.1
7 years ago
1.0.0
7 years ago