Add README.md
This commit is contained in:
19
README.md
Normal file
19
README.md
Normal 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
6
app.js
@@ -17,8 +17,10 @@
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const zlib = require('zlib');
|
const zlib = require('zlib');
|
||||||
|
|
||||||
const input = fs.createReadStream('style.css'); // Replace 'yourfile.js' with the name of your JS file
|
const fileName = "style.css";
|
||||||
const output = fs.createWriteStream('style.css.gzip'); // The output will be 'yourfile.js.gz'
|
|
||||||
|
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);
|
input.pipe(zlib.createGzip()).pipe(output);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user