{"id":13671502,"url":"https://github.com/google/closure-compiler-js","last_synced_at":"2025-09-29T00:32:50.664Z","repository":{"id":65981103,"uuid":"63377929","full_name":"google/closure-compiler-js","owner":"google","description":"Package for the JS version of closure-compiler for use via NPM","archived":true,"fork":false,"pushed_at":"2020-07-27T23:41:18.000Z","size":99,"stargazers_count":1838,"open_issues_count":0,"forks_count":62,"subscribers_count":55,"default_branch":"master","last_synced_at":"2025-09-20T20:20:24.570Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://github.com/google/closure-compiler","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-07-15T00:06:21.000Z","updated_at":"2025-09-12T10:30:57.000Z","dependencies_parsed_at":"2023-02-19T19:01:20.989Z","dependency_job_id":null,"html_url":"https://github.com/google/closure-compiler-js","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"purl":"pkg:github/google/closure-compiler-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclosure-compiler-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclosure-compiler-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclosure-compiler-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclosure-compiler-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/closure-compiler-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fclosure-compiler-js/sbom","scorecard":{"id":436586,"data":{"date":"2025-08-11","repo":{"name":"github.com/google/closure-compiler-js","commit":"026c1c18e6c82386cc49992a747e8fe75f20b736"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Maintained","score":0,"reason":"project is archived","details":["Warn: Repository is archived."],"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 5/15 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Security-Policy","score":10,"reason":"security policy file detected","details":["Info: security policy file detected: github.com/google/.github/SECURITY.md:1","Info: Found linked content: github.com/google/.github/SECURITY.md:1","Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/google/.github/SECURITY.md:1","Info: Found text in security policy: github.com/google/.github/SECURITY.md:1"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 22 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"11 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-9vvw-cc9w-f27h","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-h6ch-v84p-w6p9","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-qh2h-chj9-jffq","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-8w4h-3cm3-2pm2"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T04:49:43.048Z","repository_id":65981103,"created_at":"2025-08-19T04:49:43.048Z","updated_at":"2025-08-19T04:49:43.048Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276865723,"owners_count":25718583,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-25T02:00:09.612Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-02T09:01:11.250Z","updated_at":"2025-09-29T00:32:50.642Z","avatar_url":"https://github.com/google.png","language":"JavaScript","readme":"# closure-compiler-js\n\n**Note**: This package is now deprecated. Distribution of the JavaScript version has been moved to the main npm distribution at https://www.npmjs.com/package/google-closure-compiler. This package will continue\nto work, but no new versions of the package will be published.\n\n\u003chr /\u003e\n\nCheck, compile, transpile, optimize and compress JavaScript with Closure Compiler in JS.\n\nThis repo tracks issues related to the publication to npmjs.org and associated plugins.\nAny bugs not related to the plugins themselves should be reported to the [main repository](https://github.com/google/closure-compiler/).\n\nUnlike other packages, this allows Closure Compiler to run entirely in JS.\n*Java is not required.*\n\nThis is an experimental release - meaning some features are not available and performance may not be on-par with the Java implementation - [details here](#transpilation).\n\n## Usage\n\n*These instructions will continue to work, but the package is deprecated.\nDevelopment has moved to https://www.npmjs.com/package/google-closure-compiler.*\n\nFirst, install the latest version:\n\n```bash\nyarn add google-closure-compiler-js --dev  # or\nnpm install --save-dev google-closure-compiler-js\n```\n\nThe module supports modern web browsers as well as Node v4 LTS, and provides `compile` as a low-level method to compile JavaScript.\nBy default, this compiles ES6 to ES5 and includes the default set of ECMAScript externs files.\nFor example:\n\n```js\nconst compile = require('google-closure-compiler-js').compile;\n\nconst flags = {\n  jsCode: [{src: 'const x = 1 + 2;'}],\n};\nconst out = compile(flags);\nconsole.info(out.compiledCode);  // will print 'var x = 3;\\n'\n```\n\nOr to install the command-line version, do:\n\n```bash\nnpm install -g google-closure-compiler-js\n```\n\nYou should now be able to run `google-closure-compiler-js` as a command.\nThe `google-closure-compiler-js` command can read from stdin or from a file.\nFor example:\n\n```bash\ngoogle-closure-compiler-js code.js \u003e minified.js\n```\n\nRun `google-closure-compiler-js --help` for full usage information.\n\n## Build Systems\n\n### Webpack\n\nYour `webpack.config.js` should look like this:\n\n```js\nconst ClosureCompiler = require('google-closure-compiler-js').webpack;\nconst path = require('path');\n\nmodule.exports = {\n  entry: [\n    path.join(__dirname, 'app.js')\n  ],\n  output: {\n    path: path.join(__dirname, 'dist'),\n    filename: 'app.min.js'\n  },\n  plugins: [\n    new ClosureCompiler({\n      options: {\n        languageIn: 'ECMASCRIPT6',\n        languageOut: 'ECMASCRIPT5',\n        compilationLevel: 'ADVANCED',\n        warningLevel: 'VERBOSE',\n      },\n    })\n  ]\n};\n```\n\n### Gulp\n\nYour `gulpfile.js` should contain a task like this:\n\n```js\nconst compiler = require('google-closure-compiler-js').gulp();\n\ngulp.task('script', function() {\n  return gulp.src('./path/to/src.js', {base: './'})\n      // your other steps here\n      .pipe(compiler({\n          compilationLevel: 'SIMPLE',\n          warningLevel: 'VERBOSE',\n          outputWrapper: '(function(){\\n%output%\\n}).call(this)',\n          jsOutputFile: 'output.min.js',  // outputs single file\n          createSourceMap: true,\n        }))\n      .pipe(gulp.dest('./dist'));\n});\n```\n\n## Flags\n\n| Flag                             | Default | Usage |\n|----------------------------------|---------|-------|\n| angularPass | false | Generate $inject properties for AngularJS for functions annotated with @ngInject |\n| applyInputSourceMaps | true | Compose input source maps into output source map |\n| assumeFunctionWrapper | false | Enable additional optimizations based on the assumption that the output will be wrapped with a function wrapper. This flag is used to indicate that \"global\" declarations will not actually be global but instead isolated to the compilation unit. This enables additional optimizations. |\n| checksOnly | false | Don't generate output. Run checks, but no optimization passes. |\n| compilationLevel | SIMPLE | Specifies the compilation level to use.\u003cbr /\u003e Options: WHITESPACE_ONLY, SIMPLE, ADVANCED |\n| dartPass | false | |\n| defines | null | Overrides the value of variables annotated with `@define`, an object mapping names to primitive types |\n| env | BROWSER | Determines the set of builtin externs to load.\u003cbr /\u003e Options: BROWSER, CUSTOM |\n| exportLocalPropertyDefinitions | false | |\n| generateExports | false | Generates export code for those marked with @export. |\n| languageIn | ES6 | Sets what language spec that input sources conform to. |\n| languageOut | ES5 | Sets what language spec the output should conform to. |\n| newTypeInf | false | Checks for type errors using the new type inference algorithm. |\n| outputWrapper | null | Interpolate output into this string, replacing the token `%output%` |\n| polymerVersion | null | Specify the Polymer version pass to use. |\n| preserveTypeAnnotations | false | |\n| processCommonJsModules | false | Process CommonJS modules to a concatenable form, i.e., support `require` statements. |\n| renamePrefixNamespace | | Specifies the name of an object that will be used to store all non-extern globals. |\n| rewritePolyfills | true | Rewrite ES6 library calls to use polyfills provided by the compiler's runtime. |\n| useTypesForOptimization | false | Enable or disable the optimizations based on available type information. Inaccurate type annotations may result in incorrect results. |\n| warningLevel | DEFAULT | Specifies the warning level to use.\u003cbr /\u003e Options: QUIET, DEFAULT, VERBOSE |\n| jsCode | [] | Specifies the source code to compile. |\n| externs | [] | Additional externs to use for this compile. |\n| createSourceMap | false | Generates a source map mapping the generated source file back to its original sources. |\n\n### Languages\n\nThe Closure Compiler supports the following languages:\n- `ECMASCRIPT3`, `ECMASCRIPT5` and `ECMASCRIPT5_STRICT`\n- `ECMASCRIPT6` and `ECMASCRIPT6_STRICT`\n- `ECMASCRIPT6_TYPED` (experimental)\n- `ECMASCRIPT_2017` (experimental)\n\n### Source Code\n\nUnless you're using Gulp's or Webpack's plugins, you'll need to specify code via flags:  \n- Both `jsCode` and `externs` accept an array containing objects in the form `{src, path, sourceMap}`.\n- Using `path` you can construct a virtual filesystem for use with ES6 or CommonJS imports \u0026mdash; although for CommonJS you'll have to set `processCommonJsModules: true`.\n\n## Transpilation\nThe JavaScript version of the Closure-Compiler is transpiled by GWT from the Java source.\nFor more details on the differences in behavior see the [super sourced files][1] in the main\nrepository.\n\n[1]: https://github.com/google/closure-compiler/tree/master/src/com/google/javascript/jscomp/gwt/super\n\n## Version History\n\nClosure Compiler release notes can be found on the\n[main repository wiki](https://github.com/google/closure-compiler/wiki/Binary-Downloads).\n\n## License\n\nCopyright © 2017 The Closure Compiler Authors\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n   http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fclosure-compiler-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fclosure-compiler-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fclosure-compiler-js/lists"}