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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@scat1995/archiver

v2.1.3

Published

dist folder Archiver

Readme

@scat1995/archiver

A universal plugin for Webpack, Vite, Rollup to archive the bundle directory which supports .zip .tar .tgz formats.

Module formats

Plugin that supports multiple module formats — ESModule and CommonJS — and automatically applies the most appropriate import strategy based on the runtime environment.

Added support for ESModule and CommonJS environments in version 1.0.3. UMD is no longer supported in version 2.0.0. Webpack plugin is supported in version 2.0.0+.

| Module formats | CommonJS | ESModule | | :--------------------: | :------: | :------: | | Applicable Environment | Node.js | Node.js |

Installaion

NPM

# 1.0.0 ~ 1.0.6 (Deprecated)
npm install rollup-plugin-compressor --dev
# 2.0.0+
npm install @scat1995/archiver --dev

Usage

Modify configuration file of project. it would archive dist directory to dist.tar.gz by default. For example:

Vite

For 1.0.0 ~ 1.0.6 (Deprecated)

// vite.config.ts
import { defineConfig } from 'vite'
import Compressor from 'rollup-plugin-compressor'
/* ...Your code... */
export default defineConfig({
  /* ...Your code... */
  plugins: [
    Compressor({ ... })
  ]
  /* ...Your code... */
})

For 2.0.0+

// vite.config.ts
import { defineConfig } from 'vite'
import { VitePluginArchiver } from '@scat1995/archiver'
/* ...Your code... */
export default defineConfig({
  /* ...Your code... */
  plugins: [
    VitePluginArchiver({ ... })
  ]
  /* ...Your code... */
})

Rollup

For 1.0.0 ~ 1.0.6 (Deprecated)

// rollup.config.ts
import { defineConfig } from 'rollup'
import Compressor from 'rollup-plugin-compressor'
/* ...Your code... */
export default defineConfig({
  /* ...Your code... */
  plugins: [
    Compressor({ ... })
  ]
  /* ...Your code... */
})

For 2.0.0+

// rollup.config.ts
import { defineConfig } from 'rollup'
import { RollupPluginArchiver } from '@scat1995/archiver'
/* ...Your code... */
export default defineConfig({
  /* ...Your code... */
  plugins: [
    RollupPluginArchiver({ ... })
  ]
  /* ...Your code... */
})

Webpack

For 2.0.0+

// vue.config.js / webpack.config.js
const { ArchiverWebpackPlugin } = require('@scat1995/archiver')
/* ...Your code... */
module.exports = {
  /* ...Your code... */
  // 1. Plugins
  plugins: [
    new ArchiverWebpackPlugin({ ... })
  ]
  /* ...Your code... */
  // 2. ChainWebpack
  chainWebpack: (config) => {
    config.plugin('archiver').use(ArchiverWebpackPlugin, [{ ... }])
  }
  /* ...Your code... */
}

NodeJS

For 2.0.3+

Supports external archiving operations.

ESModule
import Archiver from '@scat1995/archiver'

Archiver.exec({ ... })
CommonJS
For 2.0.3+
const Archiver = require('@scat1995/archiver')

Archiver.default.exec({ ... })
// Otherwise you have to call it recursively, or an error will occur. 
// This is a mistake, caused by the developer's negligence.
Archiver.default.default.exec({ ... })
For 2.1.1+

Exports has been optimized. .default is no longer needed.

const Archiver = require('@scat1995/archiver')

Archiver.exec({ ... })

Options Description

| Option | Default | Description | Optional | version | | :-------------: | :-------------: | :---------------------------------------------------------------------------------------------------------------------------------------------: | :---------------------------: | :---------: | | format | 'tgz' | Archive format | 'zip' | 'tar' | 'tgz' | 2.1.1+ | | type | 'tgz' | 2.1.1+ deprecatedAlias for format | 'zip' | 'tar' | 'tgz' | 2.0.0+ | | targetPath | 'dist.tar.gz' | Output archive file name | | 2.0.0+ | | targetName | 'dist.tar.gz' | 2.0.0+ deprecatedAlias for targetPath | | 1.0.0~1.0.6 | | sourceDir | 'dist' | Directory to archive | | 2.0.0+ | | sourceName | 'dist' | 2.0.0+ deprecatedAlias for sourceDir | | 1.0.0~1.0.6 | | includeSource | true | If false, only archive contents inside the folder | true | false | 2.0.0+ | | ignoreBase | false | 2.0.0+ deprecatedIf true, only archive contents inside the folder | true | false | 1.0.0~1.0.6 | | clear | true | If true, clear the existing archived file before archiving | true | false | 2.0.0+ | | clearAll | false | If true, clear all the existing archived file ('zip' | 'tar' | 'tgz') before archiving | true | false | 2.0.0+ | | recursive | false | If true, recursively clear all the existing archived file ('zip' | 'tar' | 'tgz') before archiving from subdirectories of sourceDir | true | false | 2.0.0+ |

Note: The extname of targetPath will be automatically adjusted to match the type.

  • Example: type = 'tgz', targetPath = 'dist.tar.gz' 👇 Archived file: dist.zip.tar.gz
  • Example: type = 'tgz', targetPath = 'dist.zip' 👇 Archived file: dist.zip.tar.gz
  • Example: type = 'tgz', targetPath = 'dist' 👇 Archived file: dist.tar.gz

Advanced Usage

When type or targetPath is a string array, all possible combinations will be enumerated and these archive files will be generated. An example is as follows:

// vite.config.ts
import { defineConfig } from 'vite'
// For 1.0.0 ~ 1.0.6 (Deprecated)
import Archiver from 'rollup-plugin-compressor'
// For 2.0.0+
import { VitePluginArchiver as Archiver } from '@scat1995/archiver'
/* ...Your code... */
export default defineConfig({
  /* ...Your code... */
  plugins: [
    Archiver({
      sourceName: 'dist',
      type: ['zip', 'tgz'],
      targetName: ['dist/pkg1', 'dist/pkg2'],
      ignoreBase: false
    })
  ]
  /* ...Your code... */
})

After running the above code, the following files will be generated:

  • dist/pkg1.zip
  • dist/pkg1.tar.gz
  • dist/pkg2.zip
  • dist/pkg2.tar.gz

Supported Build Tools

  • ✅ Vite
  • ✅ Rollup
  • ✅ Webpack