From 73bdf1851dd1f11d5071646e54c29c5f23e4ff6c Mon Sep 17 00:00:00 2001 From: pgaca Date: Thu, 9 Oct 2025 10:21:00 +0200 Subject: [PATCH] Add README.md --- README.md | 19 +++++++++++++++++++ app.js | 6 ++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..633ea0e --- /dev/null +++ b/README.md @@ -0,0 +1,19 @@ +# GZIP app # + +It's an app to gzip css or js file from old idosell site templates(XSLT). + +### How to use ### +1. Put files in your local folder in VSCode or other IDE +2. use command "npm i" in that folder +3. copy your desired file in same folder(shop.js, style.css) +4. in app.js change fileName to the one you put in folder +5. use command "node app.js" +6. replace your old .gzip file with new you generated + + +REMEMBER TO CHANGE CACHE NUMBER IN XSLT FILES YOUR CHANGES NEED TO SHOW UP IN + + +--- + +Created by **[IdoMods](https://idomods.pl/)** 2025 \ No newline at end of file diff --git a/app.js b/app.js index 153d298..366e2a9 100644 --- a/app.js +++ b/app.js @@ -17,8 +17,10 @@ const fs = require('fs'); const zlib = require('zlib'); -const input = fs.createReadStream('style.css'); // Replace 'yourfile.js' with the name of your JS file -const output = fs.createWriteStream('style.css.gzip'); // The output will be 'yourfile.js.gz' +const fileName = "style.css"; + +const input = fs.createReadStream(fileName); // Replace 'yourfile.js' with the name of your JS file +const output = fs.createWriteStream(`${fileName}.gzip`); // The output will be 'yourfile.js.gz' input.pipe(zlib.createGzip()).pipe(output);