@ffflorian/jszip-cli
A zip CLI based on jszip.
Last updated 3 months ago by ffflorian .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @ffflorian/jszip-cli 
SYNC missed versions from official npm registry.

jszip-cli Build Status npm version Dependabot Status

A zip CLI based on jszip.

Installation

Run yarn global add @ffflorian/jszip-cli or npm i -g @ffflorian/jszip-cli.

Usage

CLI

Usage: jszip-cli [options] [command]

A zip CLI based on jszip.

Options:

  --noconfig                         don't look for a configuration file
  -c, --config <path>                use a configuration file (default: .jsziprc.json)
  -o, --output <dir>                 set the output directory (default: stdout)
  -i, --ignore <entry>               ignore a file or directory
  -f, --force                        force overwriting files and directories when extracting (default: false)
  -d, --dereference                  dereference (follow) links (default: false)
  -l, --level <number>               set the compression level (default: 5)
  -V, --verbose                      enable verbose logging (default: false)
  -q, --quiet                        don't log anything (default: false)
  -v, --version                      output the version number
  -h, --help                         output usage information

Commands:

  add|a [options] [entries...]       add files and directories to a new ZIP archive
  extract|e [options] <archives...>  extract files and directories from ZIP archive(s)

Configuration file

To use a configuration file, add a configuration file following the cosmiconfig standard (e.g. .jsziprc.json) to your project and the JSZip CLI will find it automatically. Options from the CLI still take precedence over the configuration file.

The structure of the configuration file is the following:

{
  /** The compression level to use (0 = save only, 9 = best compression) (default: 5). */
  compressionLevel?: number;

  /** Use a configuration file (default: .jsziprc.json). */
  configFile?: string | boolean;

  /** Whether to dereference (follow) symlinks (default: false). */
  dereferenceLinks?: boolean;

  /** Which files or directories to add. */
  entries: string[];

  /** Force overwriting files and directories when extracting (default: false). */
  force?: boolean;

  /** Ignore entries (e.g. `*.js.map`). */
  ignoreEntries?: string[];

  /** Add or extract files. */
  mode: 'add' | 'extract';

  /** Set the output directory (default: stdout). */
  outputEntry?: string | null;

  /** Don't log anything excluding errors (default: false). */
  quiet?: boolean;

  /** Enable verbose logging (default: false). */
  verbose?: boolean;
}

If you would like to use a custom configuration file, start the CLI with the option --config <file>.

Examples

CLI examples

jszip-cli add --ignore *.map --output deploy.zip dist/ package.json

jszip-cli add --ignore *.map dist/ package.json > deploy.zip

jszip-cli extract --output deployment_files/ deploy.zip

Configuration file examples

Current Tags

  • 3.0.0                                ...           latest (3 months ago)

20 Versions

  • 3.0.0                                ...           3 months ago
  • 2.3.1                                ...           4 months ago
  • 2.3.0                                ...           4 months ago
  • 2.2.0                                ...           5 months ago
  • 2.1.4                                ...           9 months ago
  • 2.1.3                                ...           10 months ago
  • 2.1.2                                ...           a year ago
  • 2.1.1                                ...           a year ago
  • 2.1.0                                ...           a year ago
  • 2.0.1                                ...           a year ago
  • 2.0.0                                ...           a year ago
  • 1.4.2                                ...           a year ago
  • 1.4.1                                ...           a year ago
  • 1.4.0                                ...           a year ago
  • 1.3.0                                ...           a year ago
  • 1.2.2                                ...           a year ago
  • 1.2.1                                ...           a year ago
  • 1.2.0                                ...           a year ago
  • 1.1.0                                ...           a year ago
  • 1.0.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 1
Last Day 1
Last Week 0
Last Month 4
Dependencies (6)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |