How to use the @xmcl/unzip.Unzip.open function in @xmcl/unzip

To help you get started, we’ve selected a few @xmcl/unzip 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 Voxelum / minecraft-launcher-core-node / packages / common / index.ts View on Github external
async openFileSystem(basePath: string | Uint8Array): Promise {
        if (typeof basePath === "string") {
            const stat = await promises.stat(basePath);
            if (stat.isDirectory()) {
                return new DefaultFS(basePath);
            } else {
                const zip = await Unzip.open(basePath, { lazyEntries: false });
                return new ZipFS(basePath, zip);
            }
        } else {
            const zip = await Unzip.open(basePath as Buffer, { lazyEntries: false });
            return new ZipFS("", zip);
        }
    }
    decodeBase64(input: string): string {
github Voxelum / minecraft-launcher-core-node / packages / common / index.ts View on Github external
async openFileSystem(basePath: string | Uint8Array): Promise {
        if (typeof basePath === "string") {
            const stat = await promises.stat(basePath);
            if (stat.isDirectory()) {
                return new DefaultFS(basePath);
            } else {
                const zip = await Unzip.open(basePath, { lazyEntries: false });
                return new ZipFS(basePath, zip);
            }
        } else {
            const zip = await Unzip.open(basePath as Buffer, { lazyEntries: false });
            return new ZipFS("", zip);
        }
    }
    decodeBase64(input: string): string {

@xmcl/unzip

A easy unzip interface based on yauzl

MIT
Latest version published 1 year ago

Package Health Score

56 / 100
Full package analysis