Registry / devops / google-closure-compiler-macos

google-closure-compiler-macos

JSON →
library20260428.0.0jsnpmunverified

Mac OS native binary distribution of the Google Closure Compiler, a JavaScript optimizer and minifier. Version 20260428.0.0 corresponds to the Closure-Compiler release 20260428. Frequent updates (weekly). This package is one of platform-specific packages; the main entry point is 'google-closure-compiler'. It automatically detects the platform and installs the appropriate binary. Key differentiator: provides a native Java binary for macOS (x64 and arm64) instead of requiring a separate Java runtime installation, but still requires Java to be available. Unlike other minifiers (Terser, esbuild), it performs advanced optimizations like type-based inlining and dead code elimination. Not intended for direct import; use the main package.

npm install google-closure-compiler-macos
INSTALL
IMPORT
SIG · GOOGLE-CLOSURE-COM
G
google-closure-compiler-macos
devopsjavascriptv20260428.0.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compile
import { compile } from 'google-closure-compiler'
import { compile } from 'google-closure-compiler-macos'
Do not import directly from platform-specific package. Use the main 'google-closure-compiler' package.
closureCompiler
import closureCompiler from 'google-closure-compiler'
import closureCompiler from 'google-closure-compiler-macos'
Default export from main package. Avoid platform-specific imports.

Shows how to use the main package's compile function with common options for advanced optimization.

// Install: npm install google-closure-compiler import { compile } from 'google-closure-compiler'; const compilation = await compile({ compilation_level: 'ADVANCED', js: ['src/**/*.js'], js_output_file: 'dist/bundle.min.js', language_in: 'ECMASCRIPT_2020', language_out: 'ECMASCRIPT5', rewrite_polyfills: false, }); if (compilation.errors) { console.error('Compilation errors:', compilation.errors); } else { console.log('Compiled output:', compilation.outputFiles); }
google-closure-compiler --version
Debug
Known issues
gotchaInstall the main 'google-closure-compiler' package, not the platform-specific package like 'google-closure-compiler-macos'.
fix
npm install google-closure-compiler
affects: *
breakingJava is required at runtime; the package only provides the closure-compiler.jar and a Java wrapper. Ensure Java 8+ is installed.
fix
Install Java 8 or later (e.g., via OpenJDK).
affects: *
gotchaThe compiler binary is platform-specific; the main package automatically selects the correct platform package (linux, macos, or windows).
fix
Do not manually install platform packages; let the main package handle it.
affects: >=20200000
Errors
Common errors & fixes
Error: Cannot find module 'google-closure-compiler-macos'
Installed the platform package instead of the main package.
fix
Run: npm install google-closure-compiler
Error: Java not found. Please install Java and ensure it is in your PATH.
Java runtime is not installed.
fix
Install OpenJDK 8+ and add 'java' to PATH.
Error: The platform "win32" is incompatible with this module.
Using macos package on non-Mac OS.
fix
Install the main package: npm install google-closure-compiler
Upgrade
Version history
20260428.0.0latest on npm
Audit
Dependencies
google-closure-compilerrequiredMain distribution package; this platform package is typically installed as a dependency of the main package.
Agent activity
4 hits · last 30 days
node
4
Resources
google-closure-compiler-macos — npm install google-closure-compiler-macos · libregistry