1.0.34 • Published 10 months ago
7zip-bin-wrapper v1.0.34
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.33
10 months ago
1.0.32
10 months ago
1.0.31
10 months ago
1.0.34
10 months ago
1.0.29
1 year ago
1.0.30
1 year ago
1.0.28
2 years ago
1.0.26
2 years ago
1.0.25
2 years ago
1.0.24
2 years ago
1.0.27
2 years ago
1.0.23
2 years ago
1.0.22
2 years ago
1.0.21
3 years ago
1.0.20
3 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
4 years ago
1.0.16
4 years ago
1.0.15
4 years ago
1.0.14
4 years ago
1.0.13
4 years ago
1.0.12
4 years ago
1.0.11
4 years ago
1.0.10
5 years ago
1.0.9
5 years ago
1.0.8
5 years ago
1.0.7
5 years ago
1.0.6
5 years ago
1.0.5
5 years ago
1.0.4
5 years ago
1.0.3
5 years ago
1.0.2
5 years ago
1.0.1
5 years ago
1.0.0
5 years ago