🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

google-closure-compiler-linux

Package Overview
Dependencies
Maintainers
4
Versions
2094
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-closure-compiler-linux

Check, compile, optimize and compress Javascript with Closure-Compiler using Java

20250609.0.0
Source
npm
Version published
Weekly downloads
96K
25.14%
Maintainers
4
Weekly downloads
 
Created

What is google-closure-compiler-linux?

The google-closure-compiler-linux npm package is a tool for optimizing JavaScript. It compiles JavaScript into a more efficient form, reducing file size and improving performance. It can also check for errors and provide warnings about potential issues in the code.

What are google-closure-compiler-linux's main functionalities?

Minification

This feature allows you to minify JavaScript files, reducing their size and improving load times. The code sample demonstrates how to use the package to minify a file named 'input.js' and output the result to 'output.min.js'.

const closureCompiler = require('google-closure-compiler-linux').compiler;
const compiler = new closureCompiler({
  js: 'input.js',
  compilation_level: 'SIMPLE',
  js_output_file: 'output.min.js'
});
compiler.run((exitCode, stdOut, stdErr) => {
  if (exitCode === 0) {
    console.log('Minification successful:', stdOut);
  } else {
    console.error('Error during minification:', stdErr);
  }
});

Error Checking

This feature checks for errors and warnings in your JavaScript code. The code sample shows how to compile 'input.js' with a verbose warning level, outputting the result to 'output.js' and logging any errors or warnings.

const closureCompiler = require('google-closure-compiler-linux').compiler;
const compiler = new closureCompiler({
  js: 'input.js',
  js_output_file: 'output.js',
  warning_level: 'VERBOSE'
});
compiler.run((exitCode, stdOut, stdErr) => {
  if (exitCode === 0) {
    console.log('Compilation successful:', stdOut);
  } else {
    console.error('Errors found:', stdErr);
  }
});

Advanced Optimizations

This feature performs advanced optimizations on your JavaScript code, potentially improving performance further. The code sample demonstrates how to use the package to apply advanced optimizations to 'input.js' and output the result to 'output.adv.js'.

const closureCompiler = require('google-closure-compiler-linux').compiler;
const compiler = new closureCompiler({
  js: 'input.js',
  compilation_level: 'ADVANCED',
  js_output_file: 'output.adv.js'
});
compiler.run((exitCode, stdOut, stdErr) => {
  if (exitCode === 0) {
    console.log('Advanced optimization successful:', stdOut);
  } else {
    console.error('Error during advanced optimization:', stdErr);
  }
});

Other packages similar to google-closure-compiler-linux

Keywords

javascript

FAQs

Package last updated on 11 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts