### Installing bzip2-wasm Library with npm (Shell) Source: https://github.com/2004scape/server/blob/main/src/3rdparty/bzip2-wasm/README.md This command installs the `bzip2-wasm` library using the Node Package Manager (npm). It adds the library as a dependency to your project, making the bzip2 compression and decompression functionality available for use in your JavaScript code. ```Shell npm install bzip2-wasm ``` -------------------------------- ### Demonstrating BZip2 Compression/Decompression (JavaScript) Source: https://github.com/2004scape/server/blob/main/src/3rdparty/bzip2-wasm/README.md This JavaScript example demonstrates how to use the `bzip2-wasm` library to compress and decompress data. It imports the `BZip2` class, initializes the WASM module, reads a file using Node.js's `fs` module, compresses its content, and then decompresses the compressed data, printing the original, compressed, and decompressed lengths to the console. ```JavaScript import BZip2 from "wasm-bzip2"; import fs from 'fs'; const bzip2 = new BZip2(); await bzip2.init(); const licenseText = fs.readFileSync('./LICENSE'); console.log('original length:', licenseText.length); const compressed = bzip2.compress(licenseText); console.log('compressed length:', compressed.length); const decompressed = bzip2.decompress(compressed, licenseText.length); console.log('decompressed length:', decompressed.length); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.