{"id":18353623,"url":"https://github.com/taystack/use-leet","last_synced_at":"2025-07-27T19:09:59.671Z","repository":{"id":40783603,"uuid":"240806122","full_name":"taystack/use-leet","owner":"taystack","description":"React Hook: Leet-ify your text with leet speak. React hook turns your given text value into 1337 SP34K.","archived":false,"fork":false,"pushed_at":"2023-01-05T07:22:54.000Z","size":3776,"stargazers_count":2,"open_issues_count":44,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-20T13:55:59.589Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://taystack.github.io/use-leet","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taystack.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}},"created_at":"2020-02-16T00:07:22.000Z","updated_at":"2023-08-18T21:49:40.000Z","dependencies_parsed_at":"2023-02-03T18:01:56.880Z","dependency_job_id":null,"html_url":"https://github.com/taystack/use-leet","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/taystack/use-leet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fuse-leet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fuse-leet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fuse-leet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fuse-leet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taystack","download_url":"https://codeload.github.com/taystack/use-leet/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taystack%2Fuse-leet/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266189616,"owners_count":23890077,"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-11-05T21:42:30.644Z","updated_at":"2025-07-27T19:09:59.646Z","avatar_url":"https://github.com/taystack.png","language":"JavaScript","readme":"![UseLeet](https://github.com/taystack/use-leet/blob/master/logo.png?raw=true)\n[![NPM](https://img.shields.io/npm/v/@taystack/use-leet.svg)](https://www.npmjs.com/package/@taystack/use-leet) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com) [![codecov](https://codecov.io/gh/taystack/use-leet/branch/master/graph/badge.svg)](https://codecov.io/gh/taystack/use-leet) [![License: WTFPL](https://img.shields.io/badge/License-WTFPL-brightgreen.svg)](http://www.wtfpl.net/about/) \n\n# @taystack/use-leet\n\n\u003e Leet-ify your text with leet speak. React hook turns your given text value into 1337 SP34K.\n\n[71v3 d3m0](https://taystack.github.io/use-leet/index.html)\n\n## Install\n\n```bash\nnpm install --save @taystack/use-leet\n```\n\n## Usage\n\n```jsx\nimport React from \"react\";\n\nimport { useLeet } from \"@taystack/use-leet\";\n\n\nconst Example = () =\u003e {\n  const [value, setValue, leetValue] = useLeet(\"dope hacks!\");\n  return (\u003c\u003e\n    \u003cinput\n      defaultValue={value}\n      onChange={event =\u003e setValue(event.target.value)}\n    /\u003e\n    \u003cdiv\u003e{leetValue}\u003c/div\u003e\n  \u003c/\u003e);\n}\n// =\u003e ( react fragment )\n// \u003cinput /\u003e\n// \u003cdiv\u003ed0p3 haxzorz\u003c/div\u003e\n\n\nconst ExampleWithCustomLeetMap = () =\u003e {\n  const leetMap = { c: \"¢\" };\n  const [stateValue, stateValueSetter, leetValue] = useLeet(\"nice zeebra dude\", leetMap);\n  return (\u003cdiv\u003e{leetValue}\u003c/div\u003e);\n}\n/* =\u003e \u003cdiv\u003en1¢3 z33br4 d00d\u003c/div\u003e */\n```\n\n## Setting your `leetMap` globally\n\nIt's possible to just set your optional `leetMap` from an exported global `UseLeet`. Once this is done, you don't have to worry about providing it in the hook.\n\n```jsx\nimport UseLeet from \"@taystack/use-leet\";\n\nimport App from \"./App\";\n\nconst customLeetMap = { c: \"¢\" };\nUseLeet.setMap(customLeetMap); // \u003c- set it and forget it\n\nReactDOM.render(\u003cApp /\u003e, document.getElementById('root'))\n```\n\n## default export `UseLeet`\n\n`import UseLeet from \"@taystack/use-leet\";`\n\n#### `UseLeet.setMap( HASH customLeetMap )`\n\n| argument | type | effect |\n|---|---|---|\n|customLeetMap|`HASH`|Configures matching letters to return `STRING` values|\n\n```jsx\nconst myCustomLeetMap = { a: \"@\", g: \"6\", c: \"¢\", n: \"ñ\", \"i\": \"¡\" };\nUseLeet.setMap(myCustomLeetMap);\n\nfunction ShowLeet({ text }) =\u003e {\n  const [val, setVal, leetText] = useLeet(\"I crunch granola\");\n  return (\u003c\u003e{leetText}\u003c/\u003e);\n}\n// =\u003e \"¡ ¢ruñ¢h 6r@ñ01@\"\n```\n\n#### `UseLeet.setGenerator( FUNC customGenerator )`\n| argument | type | effect |\n|---|---|---|\n|customGenerator|`FUNC`|customGenerator overrides the default leet generator. Make this method return a string|\n\n```jsx\nconst customJavaScriptLeetTranslator = text =\u003e text.toUpperCase();\n\nUseLeet.setGenerator(customJavaScriptLeetTranslator);\n\n//...\nconst [_, set_, leetVal] = useLeet(\"this text\");\n// =\u003e leetVal = \"THIS TEXT\"\n```\n\n\n## export `useLeet`\n\n`const [STRING value, FUNC setValue, STRING leetValue] = useLeet ( STRING defaultValue [, customLeetMap HASH ])`\n\nThis is essentially `const [value, setValue] = useState(\"\")` but with an extra returned item `leetValue`.\n\n| argument |  type | effect | required | default value |\n|---|---|---|---|---|\n| `defaultValue` | `STRING`| The value to initialize with | No | \"\" |\n| `customLeetMap` | `HASH` | {`key`/`value`} pairs to override default leet map | No | {} |\n\n\n| returns | type | effect |\n|---|---|---|\n| `value` | `STRING`| This is [`value`, _] = useState(`defaultValue`) |\n| `setValue` | `FUNC` | This is [`value`, `setValue`] = useState(`defaultValue`), re-converts `leetValue` automatically |\n| `leetValue` | `STRING` | The converted 7334 |\n\n\n\n## License\n\nWTFPL © [taystack](https://github.com/taystack)\n\n---\n\nThis hook is created using [create-react-hook](https://github.com/hermanya/create-react-hook).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaystack%2Fuse-leet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaystack%2Fuse-leet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaystack%2Fuse-leet/lists"}