# mnfy

> minify HTML/CSS/JS in a child process with caching

Latest version **4.2.0** (published 2015-11-04) · MIT license · 0 weekly downloads

## Install

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

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 4.2.0 |
| Published | 2015-11-04 |
| First published | 2014-11-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7 |
| Author | Jonathan Ong |
| Maintainers | jongleberry |
| Keywords | minify, minifier, css, js, child, process, subprocess |

## Links

- npm: https://www.npmjs.com/package/mnfy
- Repository: https://github.com/webdeps/mnfy
- Homepage: https://github.com/webdeps/mnfy#readme
- Issues: https://github.com/webdeps/mnfy/issues
- npm.io page: https://npm.io/package/mnfy

## Dependencies (8)

- [mz](https://npm.io/package/mz.md) ^2.0.0
- [slave](https://npm.io/package/slave.md) ^1.2.2
- [mkdirp](https://npm.io/package/mkdirp.md) 0
- [cssnano](https://npm.io/package/cssnano.md) ^3.3.1
- [postcss](https://npm.io/package/postcss.md) ^5.0.10
- [uglify-js](https://npm.io/package/uglify-js.md) ^2.4.24
- [lazyrequire](https://npm.io/package/lazyrequire.md) ^1.2.1
- [html-minifier](https://npm.io/package/html-minifier.md) ^1.0.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

- 4.2.0 (latest) — 2015-11-04
- 4.1.0 — 2015-10-26
- 4.0.0 — 2015-10-21
- 3.1.2 — 2015-09-21
- 3.1.1 — 2015-06-05
- 3.1.0 — 2014-12-22
- 3.0.0 — 2014-11-30
- 2.0.1 — 2014-11-23
- 2.0.0 — 2014-11-14
- 1.0.0 — 2014-11-11

## README

# mnfy

[![NPM version][npm-image]][npm-url]
[![Build status][travis-image]][travis-url]
[![Test coverage][coveralls-image]][coveralls-url]
[![Dependency Status][david-image]][david-url]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]

Minify your HTML, CSS, and JS in a child process with caching.
Suitable for long-running build systems on multicore computers.

```js
var mnfy = require('mnfy/master')

mnfy.js('function hello(){ return "world" }').then(function (res) {
  // res.code === function hello(){return"world"}
  // res.map === ???
})
```

If you only `require('mnfy')`, the same API will be returned,
but minification will no longer run in a separate process.

## API

### mnfy.js(string, [options]).then( res => )

Minify JS. Options are passed to `uglify-js`.

### mnfy.css(string, [options]).then( res => )

Minifies CSS. Options are passed to `cssnano`.

### mnfy.html(string, [options]).then( res => )

Minifies HTML. Options are passed to `html-minifer`.

### mnfy.fork()

Create a new child process.
Uses `slave`.
By default, all minification occurs in a single child process.
Fork more processes to use more cores.

[npm-image]: https://img.shields.io/npm/v/mnfy.svg?style=flat-square
[npm-url]: https://npmjs.org/package/mnfy
[github-tag]: http://img.shields.io/github/tag/webdeps/mnfy.svg?style=flat-square
[github-url]: https://github.com/webdeps/mnfy/tags
[travis-image]: https://img.shields.io/travis/webdeps/mnfy.svg?style=flat-square
[travis-url]: https://travis-ci.org/webdeps/mnfy
[coveralls-image]: https://img.shields.io/coveralls/webdeps/mnfy.svg?style=flat-square
[coveralls-url]: https://coveralls.io/r/webdeps/mnfy
[david-image]: http://img.shields.io/david/webdeps/mnfy.svg?style=flat-square
[david-url]: https://david-dm.org/webdeps/mnfy
[license-image]: http://img.shields.io/npm/l/mnfy.svg?style=flat-square
[license-url]: LICENSE
[downloads-image]: http://img.shields.io/npm/dm/mnfy.svg?style=flat-square
[downloads-url]: https://npmjs.org/package/mnfy

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