Code Monkey home page Code Monkey logo

dist-zip's Introduction

dist-zip

Build Status Downloads Build Status

该插件实现压缩打包后的dist文件夹里的文件,方便日常工作上传到资源服务器

##功能

基于zip-local,将dist文件夹压缩

##安装

全局
npm install dist-zip -g
局部
npm install dist-zip --save-dev


##使用 你可以:

  • 全局安装,在目录下直接执行dist-zip
  • 全局/局部安装,在package.json的script中运行 dist-zip
  • 局部安装,编程式使用

编程式使用

 const distZip = require('dist-zip');
 distZip();//不指定目录,默认dist
 /**
 distZip('src')//指定目录src
 distZip(null,true,true)//不指定目录,添加版本号,要求返回buffer
 */

##可传参数

  • 目录名称 dist-zip 跟上子目录名称

如果当前目录下有子目录abc,你需要压缩abc,可以dist-zip abc

注意:不支持二级目录,不支持执行dist-zip abc/bcd,本咸鱼觉得这样已经满足需求了不想加入目录下钻,请在abc目录下再执行dist-zip

  • 压缩版命名是否添加版本号

exmaple: dist-zip -v output: xxxx_v1.0.0_xxx.zip

  • 压缩版后是否返回buffer

exmaple: dist-zip -b return: {buf:xxxx,fileName:xxx.zip}

##更新

  • v1.2.0 引入optimist 添加版本号功能 -tag
  • v1.2.1 修复参数读取bug,将-tag改成更简单的-v,文件名版本号前加v
  • v1.3.0 加颜色
  • v1.3.1 除去debug输出
  • v1.3.4 更新文件夹不存在输出为中文
  • v1.3.5 修复无package.json时不报错且无成功提示的bug
  • v1.4.0 增加文件名及buffer返回选项 -b

dist-zip's People

Stargazers

1103409364 avatar

Watchers

James Cloos avatar Zuo 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.