# ender-minify

> Interface to UglifyJS Closure Compiler and YUICompressor

Latest version **0.1.1** (published 2013-03-18) · 0 weekly downloads

## Install

```sh
npm install ender-minify
pnpm add ender-minify
yarn add ender-minify
bun add ender-minify
```

## 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.1.1 |
| Published | 2013-03-18 |
| First published | 2012-06-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+2 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 4 |
| Maintainers | rvagg |
| Keywords | minify, uglify, yuicompressor, closure |

## Links

- npm: https://www.npmjs.com/package/ender-minify
- Repository: https://github.com/ender-js/ender-minify
- Homepage: https://ender.jit.su
- npm.io page: https://npm.io/package/ender-minify

## Dependencies (1)

- [uglify-js](https://npm.io/package/uglify-js.md) ~1.3.0

## Recent versions

- 0.1.1 (latest) — 2013-03-18
- 0.1.0 — 2012-12-25
- 0.0.4 — 2012-12-25
- 0.0.3 — 2012-10-16
- 0.0.2 — 2012-07-11
- 0.0.1-2 — 2012-07-03
- 0.0.1 — 2012-06-02
- 0.0.0 — 2012-06-02

## README

# Ender Minify [![Build Status](https://secure.travis-ci.org/ender-js/ender-minify.png)](http://travis-ci.org/ender-js/ender-minify)

Bundled minifier utilities for Node, designed primarily for use with the [Ender CLI](https://github.com/ender-js/Ender/).

## About Ender

For more information check out [http://ender.jit.su](http://ender.jit.su)

## API

### enderMinify() ([UglifyJS](https://github.com/mishoo/UglifyJS))

```js
var fs = require('fs')
var em = require('ender-minify')
var options = {} // no options for UglifyJS at the moment

fs.readFile('source.js', 'utf-8', function (err, source) {
  if (err) throw err

  em('uglify', source, options, function (err, minifiedSource) {
    if (err) throw err

    fs.writeFile('source.min.js', minifiedSource, 'utf-8')
  })
})
```

### enderMinify() ([Closure Compiler](http://closure-compiler.googlecode.com/))

```js
var fs = require('fs')
var em = require('ender-minify')
var options = {
  level: 'simple',                 // can be 'whitespace', 'simple' or 'advanced'
  externs: [ 'foo.js', 'bar.js' ]  // passed as --externs
}

fs.readFile('source.js', 'utf-8', function (err, source) {
  if (err) throw err

  em('closure', source, options, function (err, minifiedSource) {
    if (err) throw err

    fs.writeFile('source.min.js', minifiedSource, 'utf-8')
  })
})
```

### YUICompressor coming soon...

-----------------------------

### enderMinify.minifiers

A list of minifiers available as an array.

-----------------------------

### enderMinify.closureLevels

An object with mappings of the Closure Compiler compression levels, from nice-key to verbose-Closure-key.

i.e.:

```js
{
    whitespace : 'WHITESPACE_ONLY'
  , simple     : 'SIMPLE_OPTIMIZATIONS'
  , advanced   : 'ADVANCED_OPTIMIZATIONS'
}
```

-----------------------------

### enderMinify.closureJar

The absolute path name to the *closure.jar* file used to run Closure Compiler within this package. Useful if you wanted to call it directly.

-----------------------------

## Contributing

Contributions are more than welcome! Just fork and submit a GitHub pull request! If you have changes that need to be synchronized across the various Ender CLI repositories then please make that clear in your pull requests.

### Tests

Ender Minify uses [Buster](http://busterjs.org) for unit testing. You'll get it (and a bazillion unnecessary dependencies) when you `npm install` in your cloned local repository. Simply run `npm test` to run the test suite.

## Licence

*Ender Minify* is Copyright (c) 2012 [@rvagg](https://github.com/rvagg), [@ded](https://github.com/ded), [@fat](https://github.com/fat) and other contributors. It is licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

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