An open API service indexing awesome lists of open source software.

https://github.com/jamen/pull-minify

Minify JS and CSS files inside a pull-stream
https://github.com/jamen/pull-minify

Last synced: about 1 year ago
JSON representation

Minify JS and CSS files inside a pull-stream

Awesome Lists containing this project

README

          

# pull-minify

> Minify JS and CSS files inside a pull-stream

```js
pull(
read(__dirname + '/src/**/*.{js,css}'),
minify({
js: { mangle: true, toplevel: true },
css: { restructure: true }
}),
write(__dirname + '/out')
)
```

## Install

```sh
npm install --save pull-minify
```

```sh
yarn add pull-minify
```

## Usage

### `minify(options)`

Minifies CSS and JS files based on extension

Options are `options.js` and `options.css` which go to `minify.js` and `minify.css`.

```js
pull(
read(__dirname + '/src/**/*.{js,css}'),
minify({
js: { ...options.js },
css: { ...options.css }
}),
write(__dirname + '/out')
)
```

You can opt out by passing `js: false`, `css: false`, etc.

### `minify.js(options)`

### `minify.css(options)`

Convenience functions. They are identical to:

- [`pull-minify-js`](https://github.com/jamen/pull-minify-js)
- [`pull-minify-css`](https://github.com/jamen/pull-minify-css)

---

Maintained by [Jamen Marz](https://git.io/jamen) (See on [Twitter](https://twitter.com/jamenmarz) and [GitHub](https://github.com/jamen) for questions & updates)