npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

allzip-plugin

v1.0.0

Published

all file zip plugin

Downloads

3

Readme

GitHub stars GitHub issues GitHub license

allzip-plugin

打包所有文件并生成zip包

基于 jszip 库进行文件压缩

安装

npm i allzip-plugin --save-dev

使用

在webpack中使用

webpack.config.js

const AllZipPlugin = require('allzip-plugin')

module.exports = {
  // 省略其他配置。。。
  plugins: [new AllZipPlugin({
    filename:'output',  // 输出文件名 output.zip
    fileOptions: {...}, // 压缩文件设置
    generateOptions: {...}, // 生成文件设置
  })],
}

配置

filename

设置输出文件名,自动以.zip为后缀

module.exports = {
  // 省略其他配置。。。
  plugins: [new AllZipPlugin({
    filename:'output'  // 输出文件名 output.zip
  })],
}

fileOptions

zip压缩配置

module.exports = {
  // 省略其他配置。。。
  plugins: [new AllZipPlugin({
    fileOptions: {
      base64:true
    }
  })],
}
/** Set to `true` if the data is `base64` encoded. For example image data from a `<canvas>` element. Plain text and HTML do not need this option. */
base64?: boolean;
/**
 * Set to `true` if the data should be treated as raw content, `false` if this is a text. If `base64` is used,
 * this defaults to `true`, if the data is not a `string`, this will be set to `true`.
 */
binary?: boolean;
/**
 * The last modification date, defaults to the current date.
 */
date?: Date;
compression?: string;
comment?: string;
/** Set to `true` if (and only if) the input is a "binary string" and has already been prepared with a `0xFF` mask. */
optimizedBinaryString?: boolean;
/** Set to `true` if folders in the file path should be automatically created, otherwise there will only be virtual folders that represent the path to the file. */
createFolders?: boolean;
/** Set to `true` if this is a directory and content should be ignored. */
dir?: boolean;

/** 6 bits number. The DOS permissions of the file, if any. */
dosPermissions?: number | null;
/**
 * 16 bits number. The UNIX permissions of the file, if any.
 * Also accepts a `string` representing the octal value: `"644"`, `"755"`, etc.
 */
unixPermissions?: number | string | null;

generateOptions

zip输出文件配置

module.exports = {
  // 省略其他配置。。。
  plugins: [new AllZipPlugin({
    generateOptions: {
      type: 'nodeBuffer'
    }
  })],
}
compression?: Compression;
compressionOptions?: null | {
    level: number;
};
type?: T;
comment?: string;
/**
 * mime-type for the generated file.
 * Useful when you need to generate a file with a different extension, ie: “.ods”.
 * @default 'application/zip'
 */
mimeType?: string;
encodeFileName?(filename: string): string;
/** Stream the files and create file descriptors */
streamFiles?: boolean;
/** DOS (default) or UNIX */
platform?: 'DOS' | 'UNIX';