How to use the lzma-native.versionNumber function in lzma-native

To help you get started, we’ve selected a few lzma-native examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / lzma-native / lzma-native-tests.ts View on Github external
lzma.LZMA().compress("Bananas", 4, result => {
    lzma.LZMA().decompress(result, decompressedResult => {
        console.log("Bananas" === decompressedResult.toString());
    });
});

const comp = lzma.Compressor();

process.stdin.pipe(comp).pipe(process.stdout);
lzma.crc32("Banana"); // => 69690105
lzma.checkSize("CHECK_SHA256"); // => 16
lzma.checkSize("CHECK_CRC32"); // => 4
lzma.easyDecoderMemusage(6); // => 8454192
lzma.easyEncoderMemusage(6); // => 97620499
lzma.versionString(); // => '5.2.3'
lzma.versionNumber(); // => 50020012
lzma.isXZ("Banana"); // => false

fs.open("test/hamlet.txt.xz", "r", (err: any, fd: number) => {
    if (err) return;
    // handle error
    lzma.parseFileIndexFD(fd, (err, info) => {
        // handle error
        if (err) {
            console.log(err);
        }
        // do something with e.g. info.uncompressedSize

        fs.close(fd, (err: any) => {
            /* handle error */
            if (err) {
                console.log(err);