{"id":16330861,"url":"https://github.com/amarcruz/jscc-brunch","last_synced_at":"2026-04-30T10:02:00.962Z","repository":{"id":57284055,"uuid":"70866915","full_name":"aMarCruz/jscc-brunch","owner":"aMarCruz","description":"Adds conditional compilation and compile-time variable replacement support to brunch","archived":false,"fork":false,"pushed_at":"2018-12-11T03:39:56.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-09T09:11:36.072Z","etag":null,"topics":["brunch","brunch-plugin","comments","compilation","conditional","es6","javascript","preprocessor","sourcemap","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aMarCruz.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-10-14T02:34:09.000Z","updated_at":"2018-12-11T03:37:46.000Z","dependencies_parsed_at":"2022-09-10T09:02:07.975Z","dependency_job_id":null,"html_url":"https://github.com/aMarCruz/jscc-brunch","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/aMarCruz/jscc-brunch","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Fjscc-brunch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Fjscc-brunch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Fjscc-brunch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Fjscc-brunch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aMarCruz","download_url":"https://codeload.github.com/aMarCruz/jscc-brunch/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aMarCruz%2Fjscc-brunch/sbom","scorecard":{"id":158396,"data":{"date":"2025-08-11","repo":{"name":"github.com/aMarCruz/jscc-brunch","commit":"c1ecab5528ed850dc32f86955711373b2707458e"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/15 approved changesets -- score normalized to 0","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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":"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":"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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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: MIT License: 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"}}]},"last_synced_at":"2025-08-16T12:35:56.489Z","repository_id":57284055,"created_at":"2025-08-16T12:35:56.489Z","updated_at":"2025-08-16T12:35:56.489Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32460781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T22:27:22.272Z","status":"online","status_checked_at":"2026-04-30T02:00:05.929Z","response_time":57,"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":["brunch","brunch-plugin","comments","compilation","conditional","es6","javascript","preprocessor","sourcemap","typescript"],"created_at":"2024-10-10T23:24:45.089Z","updated_at":"2026-04-30T10:02:00.939Z","avatar_url":"https://github.com/aMarCruz.png","language":"JavaScript","funding_links":["https://ko-fi.com/C0C7LF7I"],"categories":[],"sub_categories":[],"readme":"# jscc-brunch\n\n[![npm Version][npm-image]][npm-url]\n[![License][license-image]][license-url]\n\nAdds conditional compilation and compile-time variable replacement support to [brunch](http://brunch.io).\n\njscc-brunch is **not** a transpiler, it is a wrapper of [jscc](https://github.com/aMarCruz/jscc), a tiny and powerful, language agnostic file preprocessor that uses JavaScript to transform text based on expressions at compile time.\n\nWith jscc, you have:\n\n- Conditional inclusion/exclusion of blocks, based on compile-time variables*\n- Compile-time variables with all the power of JavaScript expressions\n- Replacement of variables in the sources, by its value at compile-time\n- Sourcemap support, useful for JavaScript sources.\n- TypeScript v3 definitions\n\n**IMPORTANT:**\n\nFrom v2.8.3, the generation of source map is disabled by default to solve issues with many plugins that does not supports chained source maps. With sourceMaps disabled, jscc will only keep the correct line numbers.\n\nPlease read more about this in [Using Source Maps](#using-source-maps).\n\n## Install\n\nInstall the plugin via npm with `npm i jscc-brunch -D`.\n\nor, do manual install:\n\n- Add `\"jscc-brunch\": \"~x.y.z\"` to `package.json` of your brunch app.\n- If you want to use git version of plugin, use the GitHub URI `\"jscc-brunch\": \"aMarCruz/jscc-brunch\"`.\n\n## Usage\n\nIn brunch **the order matters** and jscc is a preprocessor, so please put it before compilers in the devDependencies of your `package.json`.\n\nSet the [options](#options) in your `brunch-config` file:\n\n```js\n  ...\n  plugins: {\n    jscc: {\n      values: {\n        _DEBUG: 1,\n        _MYAPP: 'My App' }\n    }\n  }\n  ...\n```\n\nUse it:\n\n```js\n/*#if _DEBUG\nconst mylib = require('mylib-debug');\n//#else */\nconst mylib = require('mylib');\n//#endif\n\nmylib.log('Starting $_MYAPP v$_VERSION...');\n```\n\noutput:\n\n```js\nconst mylib = require('mylib-debug');\n\nmylib.log('Starting My App v1.0.0...');\n```\n\nThat's it.\n\n\\* jscc has two predefined memvars: `_FILE` and `_VERSION`, in addition to giving access to the environment variables through the nodejs [`proccess.env`](https://nodejs.org/api/process.html#process_process_env) object.\n\nSee [Syntax](https://github.com/aMarCruz/jscc/wiki/Syntax) in the jscc wiki for information about templating.\n\n## Options\n\nPlain JavaScript object, with all properties optional.\n\nName         | Type            | Description\n------------ | --------------- | -----------\nescapeQuotes | string          | String with the type of quotes to escape in the output of strings: 'single', 'double' or 'both'. This has no default.\nprefixes     | string \u0026vert; RegExp \u0026vert;\u003cbr\u003eArray\u0026lt;string\u0026vert;RegExp\u0026gt; | The start of a directive. That is the characters before the '#', usually the start of comments.\u003cbr\u003e**Default** `'//'`, `'/*'`, `'\u003c!--'` (with one optional space after them).\nvalues       | object          | Plain object defining the variables used by jscc at compile-time.\nignore       | [anymatch][1] | Specify which files in your project should not be processed.\u003cbr\u003e**Default** `/^(bower_components|node_modules|vendor)\\//`\npattern      | RegExp        | Regular expression that matches the file paths you want to process.\u003cbr\u003e**Default** `/\\.(js|ts)x?$/`\nsourceMaps   | boolean       | Enable the generation of sourcemap (if `sourceMaps:true` in your brunch config).\u003cbr\u003e**Default** `false`\nsourceMapFor | [anymatch][1] | Files for which sourcemap must be generated if `sourceMaps:true`.\u003cbr\u003e**Default** JavaScript/TypeScript files.\n\n## Using Source Maps\n\nYou can enable the generation of sourcemap if your are not using JS compilers or your compiler can merge sourcemaps*:\n\n```js\n  ...\n  plugins: {\n    jscc: {\n      sourceMaps: true,        // enable sourcemap generation in jscc\n      sourceMapFor: /\\.js$/,   // allows sourcemap for .js files only\n      values: {\n        _DEBUG: 1,\n        _MYAPP: 'My App'\n      }\n    }\n  }\n  ...\n```\n\nEven with `sourceMaps: true`, sourcemap generation is limited to JavaScript/TypeScript files. You can change this with [anymatchs][1] through the `sourceMapFor` option.\n\n\\* The jscc plugin _does support_ merging sourcemaps.\n\n## Documentation\n\nYou can read in the jscc Wiki about:\n\n- [Options](https://github.com/aMarCruz/jscc/wiki/Options)\n- [Syntax](https://github.com/aMarCruz/jscc/wiki/Syntax)\n- [Keywords](https://github.com/aMarCruz/jscc/wiki/Keywords)\n- [Examples \u0026 Tricks](https://github.com/aMarCruz/jscc/wiki/Examples)\n- [Migrating to v1.0](https://github.com/aMarCruz/jscc/wiki/Migrating-)\n\n## What's New\n\n- Date and RegExp types outputs its stringified value (same behavior of the strings).\n- The `pattern` option defaults to .js, .jsx, .ts and .tsx extensions.\n- New option `escapeQuotes`.\n- Optimized ouput of property values, now you can use more than one property.\n- Using jscc v1.1.0\n\n## Support my Work\n\nI'm a full-stack developer with more than 20 year of experience and I try to share most of my work for free and help others, but this takes a significant amount of time and effort so, if you like my work, please consider...\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n[\u003cimg src=\"https://amarcruz.github.io/images/kofi_blue.png\" height=\"36\" title=\"Support Me on Ko-fi\" /\u003e][kofi-url]\n\u003c!-- markdownlint-enable MD033 --\u003e\n\nOf course, feedback, PRs, and stars are also welcome 🙃\n\nThanks for your support!\n\n## License\n\nThe [MIT License](LICENCE) (MIT)\n\nCopyright (c) 2016-2018 Alberto Martínez\n\n[npm-image]:      https://img.shields.io/npm/v/jscc-brunch.svg\n[npm-url]:        https://www.npmjs.com/package/jscc-brunch\n[license-image]:  https://img.shields.io/npm/l/express.svg\n[license-url]:    https://github.com/aMarCruz/jscc-brunch/blob/master/LICENSE\n[kofi-url]:       https://ko-fi.com/C0C7LF7I\n[1]: https://github.com/es128/anymatch\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarcruz%2Fjscc-brunch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famarcruz%2Fjscc-brunch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famarcruz%2Fjscc-brunch/lists"}