# @bizhermit/minifier

> minifier

Latest version **2.0.0-rc.1** (published 2022-07-31) · MIT license · 0 weekly downloads

## Install

```sh
npm install @bizhermit/minifier
pnpm add @bizhermit/minifier
yarn add @bizhermit/minifier
bun add @bizhermit/minifier
```

Provides the command `minifier`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.0.0-rc.1 |
| Published | 2022-07-31 |
| First published | 2022-01-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Senda Ryoichi |
| Maintainers | bizhermit |
| Keywords | bizhermit, minify, js, css, html |

## Links

- npm: https://www.npmjs.com/package/@bizhermit/minifier
- Repository: https://github.com/bizhermit/minifier
- Homepage: https://bizhermit.com
- Issues: https://github.com/bizhermit/minifier/issues
- npm.io page: https://npm.io/package/@bizhermit/minifier

## Dependencies (4)

- [csso](https://npm.io/package/csso.md) ^5.0.4
- [terser](https://npm.io/package/terser.md) ^5.14.2
- [html-minifier](https://npm.io/package/html-minifier.md) ^4.0.0
- [@bizhermit/cli-utils](https://npm.io/package/@bizhermit/cli-utils.md) ^1.0.0-rc.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 2.0.0-rc.1 (latest) — 2022-07-31
- 2.0.0-rc.0 — 2022-07-30
- 1.0.5 — 2022-02-07
- 1.0.4 — 2022-02-03
- 1.0.2 — 2022-01-27
- 1.0.1 — 2022-01-22
- 1.0.0 — 2022-01-18

## README

# File minifier

Minify file recursively.  
This tool target extension:
* .js
* .html
* .css

Warning: overwrite file.

---

## CLI

No install
```bash
npx @bizhermit/minifier <dirname> <options>
```

Install
```bash
npm i -D @bizhermit/minifier
npx minifier <dirname> <options>
```

### Options
* `-I [extensions]` ignore minify file extensions. colon-separete list.
* `--quiet` not print infomation log.

### Example

```bash
# root dir target
npx @bizhermit/minifier

# bin dir target
npx @bizhermit/minifier bin

# ignore css and html file -> only js
npx @bizhermit/minifier ./ -I css,html
```

---

## Module

Install
```bash
npm i @bizhermit/minifier
```

### Example
```ts
import minifier from "@bizhermit/minifier";

const func = async () => {
  const jsContentStr = "window.addEventListener(\"load\", () => ..."
  const minified = await minifier.minifyJs(jsContentStr);
  console.log(minified); // confirm
}
func();
```

---
_Source: https://npm.io/package/@bizhermit/minifier · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
