{"id":26351637,"url":"https://github.com/inqnuam/esbuild-plugin-sixsixsix-killer","last_synced_at":"2026-02-09T06:34:34.067Z","repository":{"id":60079393,"uuid":"535438288","full_name":"Inqnuam/esbuild-plugin-sixsixsix-killer","owner":"Inqnuam","description":"Remove bloc of code when 'if' statement meets 666 condition","archived":false,"fork":false,"pushed_at":"2022-12-13T21:16:11.000Z","size":21,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-10T20:47:16.951Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Inqnuam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-09-11T22:09:22.000Z","updated_at":"2023-11-23T02:33:28.000Z","dependencies_parsed_at":"2023-01-28T15:01:52.132Z","dependency_job_id":null,"html_url":"https://github.com/Inqnuam/esbuild-plugin-sixsixsix-killer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Fesbuild-plugin-sixsixsix-killer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Fesbuild-plugin-sixsixsix-killer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Fesbuild-plugin-sixsixsix-killer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Inqnuam%2Fesbuild-plugin-sixsixsix-killer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Inqnuam","download_url":"https://codeload.github.com/Inqnuam/esbuild-plugin-sixsixsix-killer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243858893,"owners_count":20359258,"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","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":"2025-03-16T10:33:36.426Z","updated_at":"2026-02-09T06:34:34.017Z","avatar_url":"https://github.com/Inqnuam.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SixSixSixKiller\n\n## Motivation\n\nSometimes we need to eliminate some part of our code when it is build for production but we need it in local developement.  \nWe can achieve that by a standart conditionnal expression like `if(process.env.LOCAL) {} else {}`.  \nTo reduce code size and cpu usage in production this esbuild plugin allows you to remove some part of code when 666 condition is satisfied.\n\n## Supports\n\nSyntax:\n\n- if statements (`if(666){...}`)\n- conditionnal expressions (`const someVar = 666 ? \"local text\": \"production text\"`)\n- binary expressions (`666 \u0026\u0026 console.log(\"something\")`)\n\nFile extensions:\n\n- JavaScript (`.js .mjs .cjs .jsx`)\n- TypeScript (`.ts .tsx`)\n\n## Usage\n\ninstall the plugin with your favorite package manager\n\n```bash\nyarn add -D esbuild-plugin-sixsixsix-killer\n# or\nnpm i -D esbuild-plugin-sixsixsix-killer\n```\n\nAdd `SixSixSixKiller` to your esbuild plugin list.\n\n```js\nconst esbuild = require(\"esbuild\");\nconst { SixSixSixKiller } = require(\"esbuild-plugin-sixsixsix-killer\");\n\nconst esBuildConfig = {\n  bundle: true,\n  plugins: [process.env.NODE_ENV == \"production\" \u0026\u0026 SixSixSixKiller()],\n  entryPoints: [\"./index.ts\"],\n  outdir: \"dist\",\n};\n\nesbuild.build(esBuildConfig);\n```\n\nThen simply add an if(666) condition in your code and let SixSixKiller to remove it when the plugin is applied during build phase.\n\nExamples:  \nsee [playground](playground/index.ts) for more examples and behavior info.  \nLaunch `yarn test` or `npm run test` and play with [playground/index.ts](playground/index.ts) then check the [playground/output/index.js](playground/index.ts) content.\n\n```js\nlet API_LINK = \"https://myserver.com\";\n\nif (666) {\n  API_LINK = \"http://localhost3000\";\n  console.log(\"This block will be removed by SixSixSixKiller\");\n} else if (666) {\n  console.log(API_LINK);\n  console.log(\"this block will be removed too\");\n} else if (anotherConditiion) {\n  console.log(\"This will not be removed. It will become if(anotherConditiion) {...}\");\n} else {\n  console.log(\"This one too will not be removed\");\n}\n\nconst anotherExample = 666 ? \"drop me\" : \"text in production\";\n\n// .tsx .jsx\n666 \u0026\u0026 console.log(\"This will be removed by SixSixSixKiller\");\n```\n\noutput:\n\n```js\nlet API_LINK = \"https://myserver.com\";\n\nif (anotherConditiion) {\n  console.log(\"This will not be removed. It will become if(anotherConditiion) {...}\");\n} else {\n  console.log(\"This one too will not be removed\");\n}\n\nconst anotherExample = \"text in production\";\n```\n\n## Customization\n\nIf you are not happy about the `666` condition you can change the value by any integer \u003e 0 like `911`.\n\n```js\nconst esbuild = require(\"esbuild\");\nconst { SixSixSixKiller } = require(\"esbuild-plugin-sixsixsix-killer\");\n\nconst esBuildConfig = {\n  bundle: true,\n  plugins: [process.env.NODE_ENV == \"production\" \u0026\u0026 SixSixSixKiller({ killCode: 911 })],\n  entryPoints: [\"./index.ts\"],\n  outdir: \"dist\",\n};\n\nesbuild.build(esBuildConfig);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finqnuam%2Fesbuild-plugin-sixsixsix-killer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finqnuam%2Fesbuild-plugin-sixsixsix-killer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finqnuam%2Fesbuild-plugin-sixsixsix-killer/lists"}