classic-ui-dev/scripts/helpers/save.js
2022-06-15 16:45:56 +10:00

18 lines
326 B
JavaScript

import fs from 'fs'
import zipper from 'zip-local'
export function save(fileName) {
try {
zipper.sync
.zip(`${fileName}`)
.compress()
.save(`${fileName}.zip`)
fs.unlinkSync(fileName)
return true
} catch (err) {
console.log('on save error', fileName, err.message)
return false
}
}