# sqwish

> a tool for compressing CSS

Latest version **0.2.2** (published 2014-02-11) · 0 weekly downloads

## Install

```sh
npm install sqwish
pnpm add sqwish
yarn add sqwish
bun add sqwish
```

Provides the command `sqwish`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.2 |
| Published | 2014-02-11 |
| First published | 2011-04-24 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.4.1 |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Dustin Diaz |
| Maintainers | ded, fat |
| Keywords | minify, css, compress |

## Links

- npm: https://www.npmjs.com/package/sqwish
- Homepage: https://github.com/ded/sqwish
- npm.io page: https://npm.io/package/sqwish

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.2.2 (latest) — 2014-02-11
- 0.2.1 — 2012-12-17
- 0.2.0 — 2011-05-24
- 0.1.2 — 2011-04-30
- 0.1.1 — 2011-04-26
- 0.1.0 — 2011-04-26
- 0.0.9 — 2011-04-25
- 0.0.8 — 2011-04-25
- 0.0.7 — 2011-04-25
- 0.0.6 — 2011-04-24
- 0.0.5 — 2011-04-24
- 0.0.4 — 2011-04-24
- 0.0.3 — 2011-04-24
- 0.0.2 — 2011-04-24
- 0.0.1 — 2011-04-24

## README

Welcome to Sqwish
=================

A [Node](http://nodejs.org) based CSS Compressor. It works like this.

``` javascript
require('sqwish').minify('body { color: #ff33cc; }');
// => "body{color:#f3c}"
```

CLI
---

Install it.

    $ npm install -g sqwish

Use it like this:

    $ sqwish app.css # default output is <file>.min.css therefore app.css => app.min.css
    $ # or...
    $ sqwish css/styles.css -o prod/something-else.min.css

Notes
-----

Sqwish does not attempt to fix invalid CSS, therefore, at minimum, your CSS should at least follow the basic rules:

``` css
selectors[,more selectors] {
  property: value;
  another-property: another value;
}
```

Strict Optimizations
--------------------

Aside from regular minification, in <code>--strict</code> mode Sqwish will combine duplicate selectors and merge duplicate properties.

``` css
/* before */
div {
  color: orange;
  background: red;
}
div {
  color: #ff33cc;
  margin: 1px 0px 1px 0px;
}

/* after */
div{color:#f3c;background:red;margin:1px 0}
```

This mode can be enabled as so:

    sqwish.minify(css, true);

on the command line

    $ sqwish styles.css --strict

Developers
----------

Be sure you have the proper testing harness set up ahead of time by installing the <code>sink-test</code> submodule

    $ npm install --dev

Tests can be added in <code>tests/tests.js</code>, and then run as such:

    $ npm test

License
-------

Sqwish is copyright Dustin Diaz 2011 under MIT License

**Happy Sqwishing!**

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