Add README.md

This commit is contained in:
2025-10-09 10:21:00 +02:00
parent 52f50e2060
commit 73bdf1851d
2 changed files with 23 additions and 2 deletions

19
README.md Normal file
View File

@@ -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

6
app.js
View File

@@ -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);