@morpheus/addon-zip
라이브러리에서 제공되는 모듈
Before M.zip.zip
여러 파일을 압축하여 ZIP 파일로 생성합니다.
Parameters
options
Object
string
Array<{ path: string, name: string }>
boolean
boolean
string
Return
Promise<Object>
"SUCCESS"
| "FAIL"
string
string
string
string
number
string
string
Usage
import { zip } from '@morpheus/addon-zip'
zip({
path: 'downloads/archive.zip',
list: [
{ path: 'files/doc1.pdf', name: '문서1.pdf' },
{ path: 'files/img.jpg', name: '이미지.jpg' }
],
overwrite: true,
password: 'secure123'
}).then(result => {
if (result.status === 'SUCCESS') {
console.log('압축 완료:', result.fullpath);
} else {
console.error('압축 실패:', result.message);
}
})
Before M.zip.unzip
ZIP 파일을 지정한 경로에 압축 해제합니다.
Parameters
options
Object
string
string
boolean
boolean
string
Return
Promise<Object>
"SUCCESS"
| "FAIL"
string
string
string
string
number
string
string
Usage
import { unzip } from '@morpheus/addon-zip'
unzip({
path: 'downloads/archive.zip',
destination: 'downloads/unpacked',
overwrite: true,
password: 'secure123'
}).then(result => {
if (result.status === 'SUCCESS') {
console.log('압축 해제 완료:', result.fullpath);
} else {
console.error('압축 해제 실패:', result.message);
}
})