Preparing search index...

    Module to zip and unzip files.

        // Editor.Compression.Zip wraps a directory tree into a single .zip and
    // (un)packs it back. Below: stage a couple of assets in a temp dir,
    // zip the whole directory, then unpack into a sibling location.
    const fs = await import('LensStudio:FileSystem');

    const tmp = fs.TempDir.create();
    const sourceDir = tmp.path.appended(new Editor.Path('assets'));
    fs.createDir(sourceDir, { recursive: true } as any);

    fs.writeFile(sourceDir.appended(new Editor.Path('readme.txt')), 'sample asset bundle');
    fs.writeFile(sourceDir.appended(new Editor.Path('config.json')), JSON.stringify({ version: 1 }));

    // Pack the directory into a single archive
    const archive = tmp.path.appended(new Editor.Path('assets.zip'));
    Editor.Compression.Zip.pack(sourceDir, archive);
    console.log('packed:', archive, 'size:', fs.size(archive));

    // Unpack into a sibling directory
    const out = tmp.path.appended(new Editor.Path('extracted'));
    fs.createDir(out, null as any);
    Editor.Compression.Zip.unpack(archive, out);
    console.log('unpacked entries:', fs.readDir(out, null as any).length);
    Index

    Constructors

    Methods

    Constructors

    • Snap Hidden

      Returns Zip

    Methods

    • Pack files into a zip.

      Parameters

      Returns void

    • Beta

      Unpack the zip file.

      Parameters

      Returns void