{"id":26563,"library":"uber-compiler","title":"uber-compiler","description":"Compiles client-side JS and CSS using Google Closure Compiler, Closure Templates, and LESS. Version 0.4.7 runs on Node.js >= 0.4.1. It watches files for changes, caches compiled output, and supports custom warnings/compile modes. Unlike standalone build tools, it integrates directly into a Node.js server and auto-recompiles on file changes. Maintenance appears stalled with no recent updates.","status":"maintenance","version":"0.4.7","language":"javascript","source_language":"en","source_url":"git://github.com/kennberg/node-uber-compiler","tags":["javascript","compile","compiler","compress","minify","google","closure","js"],"install":[{"cmd":"npm install uber-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add uber-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add uber-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for JS compilation via Google Closure Compiler.","package":"google-closure-compiler","optional":false}],"imports":[{"note":"The package exports a factory function directly; ESM import as default works, but CommonJS require also works.","wrong":"const uberCompiler = require('uber-compiler');","symbol":"default","correct":"import uberCompiler from 'uber-compiler';"},{"note":"The package exports a single function; named destructuring fails.","wrong":"const { uberCompiler } = require('uber-compiler');","symbol":"uberCompiler function","correct":"import uberCompiler from 'uber-compiler'; const compiler = uberCompiler(options);"},{"note":"Methods are available on the compiler instance, not exported directly from the package.","wrong":"import { getJsFilename } from 'uber-compiler';","symbol":"getJsFilename","correct":"import uberCompiler from 'uber-compiler'; const compiler = uberCompiler(options); const jsFile = compiler.getJsFilename();"}],"quickstart":{"code":"const path = require('path');\nconst uberCompiler = require('uber-compiler');\n\nconst rootPath = process.cwd();\nconst options = {\n  jsPaths: [\n    path.join(rootPath, 'public/js/lib/jquery-1.7.2.js'),\n    path.join(rootPath, 'public/js/lib/underscore.js'),\n    path.join(rootPath, 'public/js/lib/backbone.js'),\n    path.join(rootPath, 'public/js/init.js'),\n    path.join(rootPath, 'public/js/model/'),\n    path.join(rootPath, 'public/js/view/'),\n    path.join(rootPath, 'public/js/router/'),\n    path.join(rootPath, 'public/js/main.js')\n  ],\n  cssPaths: [ path.join(rootPath, 'public/css') ],\n  outputDir: path.join(rootPath, 'public/cached'),\n  debug: false\n};\nconst compiler = uberCompiler(options);\ncompiler.run();","lang":"javascript","description":"Creates an uber-compiler instance with JS and CSS paths, then compiles and watches for changes."},"warnings":[{"fix":"Use path.join with process.cwd() or __dirname to create absolute paths.","message":"The jsPaths and cssPaths arrays must contain absolute paths. Relative paths cause 'Path must be absolute' errors.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Install google-closure-compiler globally: npm i -g google-closure-compiler","message":"Dependency google-closure-compiler is a large binary and must be installed globally (npm i -g google-closure-compiler) before using uber-compiler.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Migrate to modern build tools such as webpack, gulp, or rollup.","message":"This package is no longer actively maintained. The last release was in 2012. Alternatives like webpack or gulp are recommended.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use process.on('uncaughtException') or wrap run() in try/catch for error handling.","message":"The 'endCallback' option is called after compilation completes but is not passed any arguments, making error handling difficult.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use absolute paths by prefixing with path.join(__dirname, ...) or path.resolve().","cause":"Providing relative paths in jsPaths or cssPaths.","error":"Error: Path must be absolute: relative/path/to/js"},{"fix":"Run: npm i -g google-closure-compiler","cause":"Missing google-closure-compiler dependency, which must be installed globally.","error":"Error: Cannot find module 'google-closure-compiler'"},{"fix":"Use import uberCompiler from 'uber-compiler'; instead, or rename file to .cjs.","cause":"Attempting to use CommonJS require in an ESM module file.","error":"ReferenceError: require is not defined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}