# closure-compiler-service

> Compile JavaScript with the Google Closure compiler service

Latest version **0.6.1** (published 2016-02-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install closure-compiler-service
pnpm add closure-compiler-service
yarn add closure-compiler-service
bun add closure-compiler-service
```

Provides the command `closure-service`.

## 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.6.1 |
| Published | 2016-02-01 |
| First published | 2014-07-16 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Gavin Lloyd |
| Maintainers | gavinhungry |
| Keywords | closure, compiler, compress, google, minify, service |

## Links

- npm: https://www.npmjs.com/package/closure-compiler-service
- Repository: https://github.com/gavinhungry/closure-compiler-service
- Issues: https://github.com/gavinhungry/closure-compiler-service/issues
- npm.io page: https://npm.io/package/closure-compiler-service

## Dependencies (3)

- [request](https://npm.io/package/request.md) 2.69.x
- [commander](https://npm.io/package/commander.md) 2.9.0
- [querystring](https://npm.io/package/querystring.md) 0.2.x

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.6.1 (latest) — 2016-02-01
- 0.6.0 — 2016-01-29
- 0.5.1 — 2016-01-24
- 0.5.0 — 2014-11-11
- 0.4.2 — 2014-08-26
- 0.4.1 — 2014-08-26
- 0.4.0 — 2014-08-22
- 0.3.1 — 2014-08-06
- 0.3.0 — 2014-08-06
- 0.2.2 — 2014-07-17
- 0.2.1 — 2014-07-16
- 0.2.0 — 2014-07-16

## README

closure-compiler-service
========================
Compile JavaScript with the Google
[Closure compiler service](https://developers.google.com/closure/compiler/docs/api-ref).
No Java dependency.

Installation
------------

    # npm -g install closure-compiler-service

Usage
-----

### Command Line

Output is written to stdout, and can thus be redirected to a file:

    $ closure-service input.js > input.min.js

### Module

```javascript
var ccs = require('closure-compiler-service');
var input = fs.readFileSync('input.js');

/**
 * Compile a string of JavaScript with the Closure compiler service
 *
 * @param {String|Buffer} js_code - JavaScript code to compile
 * @param {Object} [options] - API options
 * @param {Function} [callback](errs, warns, code) - defaults to console output
 */
ccs.compile(input, function(errs, warns, code) {
  // `code` is the compiled result
});
```

`ccs.compile` optionally takes an options object as the second argument (before
the callback function), which are passed to the API:

```javascript
ccs.compile(js_code, {
  compilation_level: 'WHITESPACE_ONLY'
}, function(errs, warns, code) {
  // ...
});
```

Pass an array to stipulate multiple values for the same option:

```javascript
ccs.compile(js_code, {
  code_url: [url1, url2 /*, ... */]
}, function(errs, warns, code) {
  // ...
});
```

`js_code` may be `null` if using `code_url` to provide code.

### Default Options

```javascript
output_format     = 'json' // you won't want to change this
output_info       = ['compiled_code', 'errors', 'warnings']
compilation_level = 'SIMPLE_OPTIMIZATIONS'
```

License
-------
This software is released under the terms of the **MIT license**. See `LICENSE`.

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