{"id":13725285,"url":"https://github.com/jamiebuilds/babel-plugin-hash-strings","last_synced_at":"2025-03-15T13:31:15.650Z","repository":{"id":66094728,"uuid":"281092658","full_name":"jamiebuilds/babel-plugin-hash-strings","owner":"jamiebuilds","description":"Replace all instances of \"@@strings like this\" with hashes.","archived":false,"fork":false,"pushed_at":"2020-07-20T11:31:47.000Z","size":31,"stargazers_count":35,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-06T18:18:03.224Z","etag":null,"topics":[],"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/jamiebuilds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-07-20T11:01:43.000Z","updated_at":"2022-05-06T01:47:41.000Z","dependencies_parsed_at":"2023-04-18T14:00:22.141Z","dependency_job_id":null,"html_url":"https://github.com/jamiebuilds/babel-plugin-hash-strings","commit_stats":{"total_commits":2,"total_committers":1,"mean_commits":2.0,"dds":0.0,"last_synced_commit":"6285b5853ec33bda73c11e8b17ad3a20eb1cfd27"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fbabel-plugin-hash-strings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fbabel-plugin-hash-strings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fbabel-plugin-hash-strings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jamiebuilds%2Fbabel-plugin-hash-strings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jamiebuilds","download_url":"https://codeload.github.com/jamiebuilds/babel-plugin-hash-strings/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243735843,"owners_count":20339536,"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":"2024-08-03T01:02:18.207Z","updated_at":"2025-03-15T13:31:15.340Z","avatar_url":"https://github.com/jamiebuilds.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# babel-plugin-hash-strings\n\n\u003e Replace all instances of `\"@@strings like this\"` with hashes.\n\nThis _might_ be useful for decreasing the size of your JavaScript bundles. But\nnote that gzip might actually be better for your code because hashes do not\ncompress well.\n\n## Install\n\n```sh\nnpm install --save-dev babel-plugin-hash-strings\n```\n\n## Usage\n\nIt's recommended that you only use this plugin in a production build.\n\n```js\n// babel.config.js\nlet presets = [ ... ]\nlet plugins = [ ... ]\n\nif (process.env.NODE_ENV === \"production\") {\n  plugins.push(\"babel-plugin-hash-strings\")\n}\n\nmodule.exports = { presets, plugins }\n```\n\n## Example\n\n**Input:**\n\n```js\nlet value = \"@@hash me\"\n```\n\n**Output:**\n\n```js\nlet value = \"5953c\"\n```\n\n## `options.chars`\n\nThis plugin defaults to really short hashes because you probably won't have\n_that_ many strings that uniqueness matters all that much. But just in case you\ndo have a duplicate, the plugin has a built-in check for them and you can\nincrease the length of your strings using `options.chars`\n\n```js\n// babel.config.js\nlet presets = [ ... ]\nlet plugins = [ ... ]\n\nif (process.env.NODE_ENV === \"production\") {\n  plugins.push([\"babel-plugin-hash-strings\", {\n    chars: 8 // (default: 5)\n  }])\n}\n\nmodule.exports = { presets, plugins }\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiebuilds%2Fbabel-plugin-hash-strings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjamiebuilds%2Fbabel-plugin-hash-strings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjamiebuilds%2Fbabel-plugin-hash-strings/lists"}