1.0.2 • Published 4 years ago
joli-zip v1.0.2
Simple zip files or folder with Nodejs
Requirements
- MacOS or Linux computer
Installation
- Install zip command on your computer
- Ubuntu: run
sudo apt-get install zip - CentOS: run
sudo yum install zip - MacOS: do nothing because zip is installed on MacOS by default
- Ubuntu: run
- Run
yarn add joli-zipornpm i joli-zip
Usage
Typescript
import { zip } from 'joli-zip';
import { join } from 'path';
zip(
[
'file_1.pdf',
'file_2.pdf',
// (List of files and folder to zip)
],
'test.zip', // (output file name)
{
password: 'any password', // (zip password)
workingDirectory: __dirname, // (Folder contains files to zip)
}
)Javascript
const { zip } = require('joli-zip');
const { join } = require('path')
zip(
[
'file_1.pdf',
'file_2.pdf',
// (List of files and folder to zip)
],
'test.zip', // (output file name)
{
password: 'any password', // (zip password)
workingDirectory: __dirname, // (Folder contains files to zip)
}
)