Git Product home page Git Product logo

zip-shim's Introduction

一个使用 7za 二进制命令行实现的文件压缩工具, 参数尽量于 7za cli 保持相似.

由于 jszip 不提供加密功能, 所以有了此项目.

const {
  zipShim,
} = require(`./`)

// 压缩当前目录为 zip
zipShim({
  spf: false, // 不存储绝对地址
  file: [
    __dirname,
  ],
})

// 压缩当前目录为 7z 并加密文件名, 密码为 123, 存储绝对地址
zipShim({
  t: `7z`,
  p: `123`,
  mhe: true,
  file: [
    __dirname,
  ],
})

选项和默认值

config = {
  out = `${process.cwd()}/store`, // 输出文件名
  file = [], // 要压缩的文件列表
  v = `1g`, // 分卷大小, 传 false 为不使用分卷. 注: 7za 不支持分卷
  p = undefined, // 压缩密码
  mhe = false, // 是否加密文件名
  t = `zip`, // 文件格式
  spf = true, // 是否存储绝对地址, 如果要压缩的文件名有相同时, 需要指定, 否则会出错
  mx = 0, // 配置压缩等级, 0 为不压缩, 0-9
  ignore = [
    `node_modules*`,
    `httpData*`,
    `.history`,
    `*-cache`,
    `.cache`,
    `cache`,
  ], // 要排除的文件列表
  w, // 临时文件目录
  runOpt  = {}, // runShell.run 参数
}

相似项目

zip-shim's People

Contributors

wll8 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.