{"id":25082,"library":"closure-compiler-stream","title":"closure-compiler-stream","description":"A streaming interface for Google Closure Compiler that provides full pipe support for Node.js streams. Version 0.1.15 is the latest stable release. It wraps the Closure Compiler Java application as a Node.js stream, allowing it to be used in gulp pipelines or with plain streams. Key differentiators from other Closure Compiler wrappers are its simple stream-based API and support for Gulp with sourcemaps. It supports module definitions and custom jar paths. The package is minimal and focuses on streaming rather than complex configuration.","status":"active","version":"0.1.15","language":"javascript","source_language":"en","source_url":"https://github.com/davidrekow/closure-compiler-stream","tags":["javascript","closure","closure compiler","stream","gulp"],"install":[{"cmd":"npm install closure-compiler-stream","lang":"bash","label":"npm"},{"cmd":"yarn add closure-compiler-stream","lang":"bash","label":"yarn"},{"cmd":"pnpm add closure-compiler-stream","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package uses CommonJS. ESM import may not work without a bundler.","wrong":"import closure from 'closure-compiler-stream';","symbol":"default","correct":"const closure = require('closure-compiler-stream');"},{"note":"If using a bundler or ESM environment, default import works (package has no named exports).","wrong":"","symbol":"default","correct":"import closure from 'closure-compiler-stream';"},{"note":"Do not access .default; the module directly exports the function.","wrong":"var closure = require('closure-compiler-stream').default;","symbol":"default","correct":"var closure = require('closure-compiler-stream');"}],"quickstart":{"code":"const closure = require('closure-compiler-stream');\nconst fs = require('fs');\n\n// Compile JavaScript from a file and output to another file\nfs.createReadStream('input.js')\n  .pipe(closure())\n  .pipe(fs.createWriteStream('output.min.js'));\n\n// Or with options\nfs.createReadStream('input.js')\n  .pipe(closure({ compilation_level: 'SIMPLE_OPTIMIZATIONS' }))\n  .pipe(fs.createWriteStream('output.min.js'));\n","lang":"javascript","description":"Creates a read stream from a source file, pipes through the Closure Compiler, and writes the minified output to another file."},"warnings":[{"fix":"Ensure Java (JRE) is installed and available in PATH.","message":"The module requires Java to be installed because it spawns the Closure Compiler Java jar.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Refer to the Closure Compiler flags documentation and use correct flag names.","message":"Options passed to the stream are flags for the Closure Compiler. Not all options are validated; misspelled flags may be ignored silently.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Always pipe from a readable stream into closure() and then to a writable stream.","message":"The stream returns a Writable stream but is intended to be used in a pipeline; piping to it will cause it to consume input and produce output on the next stream.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Migrate to google-closure-compiler package which provides a similar API and is actively maintained.","message":"The package is not actively maintained; last release was 0.1.15 in 2016. Consider using more modern alternatives like google-closure-compiler.","severity":"deprecated","affected_versions":">=0.1.0"}],"env_vars":null,"search_vec":"'0.1.15':21 'allow':38 'api':63 'applic':33 'base':62 'closur':2,10,30,54,91,92 'closure-compiler-stream':1 'compil':3,11,31,55,93 'complex':88 'configur':89 'custom':75 'definit':73 'differenti':51 'focus':83 'full':14 'googl':9 'gulp':44,67,95 'interfac':7 'jar':76 'java':32 'javascript':90 'key':50 'latest':24 'minim':81 'modul':72 'node.js':18,36 'packag':79 'path':77 'pipe':15 'pipelin':45 'plain':48 'provid':13 'rather':86 'releas':26 'simpl':59 'sourcemap':69 'stabl':25 'stream':4,6,19,37,49,61,85,94 'stream-bas':60 'support':16,65,71 'use':42 'version':20 'wrap':28 'wrapper':56","created_at":"2026-05-01T13:42:55.497990+00:00","updated_at":"2026-05-01T13:42:55.497990+00:00","problems":[{"fix":"Install Java (JRE) and ensure 'java' command is available.","cause":"Java is not installed or not in PATH.","error":"Error: spawn java ENOENT"},{"fix":"Ensure piping is set up correctly: source.pipe(closure()).pipe(dest);","cause":"Attempting to write to the stream after it has ended, often due to incorrect piping.","error":"Error: write after end"},{"fix":"Use require('closure-compiler-stream') and call it directly as closure().","cause":"Importing the module incorrectly, e.g., as an ESM default import without bundler or using .default.","error":"TypeError: closure is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/davidrekow/closure-compiler-stream","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/closure-compiler-stream","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}