Gathering detailed insights and metrics for czlink
Gathering detailed insights and metrics for czlink
Gathering detailed insights and metrics for czlink
Gathering detailed insights and metrics for czlink
npm install czlink
Typescript
Module System
Node Version
NPM Version
57.8
Supply Chain
89.9
Quality
73.5
Maintenance
100
Vulnerability
97
License
Cumulative downloads
Total Downloads
Last Day
0%
2
Compared to previous day
Last Week
50%
3
Compared to previous week
Last Month
300%
8
Compared to previous month
Last Year
0%
299
Compared to previous year
CzLink
is a Node.js package for creating and serving zip files from specified input paths. It includes basic functionality to zip files or directories and serve them over HTTP with progress updates.
To install CzLink
, run:
1npm install czlink
First, set up the zip process and start the server:
1const czlink = require('czlink'); 2 3czlink({ 4 sourceFolder: './data', // Folder to be zipped 5 outputFolder: './backups', // Folder where the zip files will be saved 6 expressAlr: false, // If true, it will not start the express server 7 port: 4000 // Custom port for the Express server 8});
Once the server is running, you can download the zip file using the following URL:
http://localhost:PORT/download/backup.zip
Replace PORT
with the port number specified in the czlink()
function call.
If an Express server is already running, you can serve the zip files without starting a new server by setting expressAlr: true
in the options:
1const czlink = require('czlink'); 2 3czlink({ 4 sourceFolder: './data', // Folder to be Backup 5 outputFolder: './backups', // Folder where the zip files will be saved 6 expressAlr: true, // If true, it will not start the express server 7 port: 4000 // Custom port for the Express server 8});
Then, in your existing Express server, add this route to serve the zip file:
1let outputFolder = "your_output_folder_goes_here"; 2app.use('/download', express.static(outputFolder));
This will allow your server to serve the zip files created by CzLink
at the /download
endpoint.
czlink(options)
Sets up the zip process and optionally starts an Express server.
sourceFolder
(string): The path to the folder or directory that will be zipped.outputFolder
(string): The path to the folder where the zip files will be saved.expressAlr
(boolean): If true
, it will not start a new Express server but expects an existing one to handle file downloads.port
(number, optional): The port number to start the Express server on if expressAlr
is false
(default is 3000
)./download/backup.zip
Starts the download of the zip file.
backup.zip
and stored in the outputFolder
.outputFolder
is recreated each time the zip process runs.expressAlr
is true
, you can use the outputFolder
path to serve the zip file from your existing server.This project is licensed under the MIT License.
Made by Coneiz.
No vulnerabilities found.