{"id":31952959,"url":"https://github.com/yoannmoinet/invisible-strings","last_synced_at":"2025-10-14T13:26:32.686Z","repository":{"id":315142731,"uuid":"1056709004","full_name":"yoannmoinet/invisible-strings","owner":"yoannmoinet","description":"Translate strings into invisible, zero-width strings, back and forth.","archived":false,"fork":false,"pushed_at":"2025-09-14T16:42:27.000Z","size":53272,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-17T00:39:34.216Z","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/yoannmoinet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-14T16:41:54.000Z","updated_at":"2025-09-14T17:12:03.000Z","dependencies_parsed_at":"2025-09-17T00:49:41.992Z","dependency_job_id":null,"html_url":"https://github.com/yoannmoinet/invisible-strings","commit_stats":null,"previous_names":["yoannmoinet/invisible-strings"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/yoannmoinet/invisible-strings","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannmoinet%2Finvisible-strings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannmoinet%2Finvisible-strings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannmoinet%2Finvisible-strings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannmoinet%2Finvisible-strings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yoannmoinet","download_url":"https://codeload.github.com/yoannmoinet/invisible-strings/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yoannmoinet%2Finvisible-strings/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279018708,"owners_count":26086608,"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-10-14T02:00:06.444Z","response_time":60,"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":"2025-10-14T13:26:30.938Z","updated_at":"2025-10-14T13:26:32.673Z","avatar_url":"https://github.com/yoannmoinet.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Invisible Strings\n\n[![npm version](https://badge.fury.io/js/invisible-strings.svg)](https://badge.fury.io/js/invisible-strings)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n\nConvert regular text into invisible, zero-width Unicode characters and back again.\n\n## What is this?\n\nInvisible Strings is a lightweight TypeScript library that allows you to convert normal text into strings composed of invisible Unicode characters. These \"invisible strings\" can be embedded in other text without being visible to readers, but they can be programmatically decoded back to the original text.\n\n## Installation\n\n```bash\n# Using npm\nnpm install invisible-strings\n\n# Using yarn\nyarn add invisible-strings\n\n# Using pnpm\npnpm add invisible-strings\n```\n\n## Usage\n\n### Basic Usage\n\n```typescript\nimport is from 'invisible-strings';\n\n// Create a new instance with a default character mapping\nconst { toInvisible, fromInvisible } = is();\n\n// Convert a string to invisible characters\nconst hiddenMessage = toInvisible('Hello World');\nconsole.log('Hidden message:', hiddenMessage); // Outputs invisible characters\n\n// Convert the invisible string back to normal text\nconst visibleMessage = fromInvisible(hiddenMessage);\nconsole.log('Visible message:', visibleMessage); // Outputs: \"Hello World\"\n```\n\n### Using Tagged Template Literals\n\nThe library also provides tagged template literals for more elegant usage:\n\n```typescript\nimport is from 'invisible-strings';\n\nconst { visible, invisible } = is();\n\n// Convert to invisible using template literal\nconst hiddenText = invisible`This text will be invisible`;\n\n// Convert back to normal text\nconst normalText = visible`${hiddenText}`;\nconsole.log(normalText); // Outputs: \"This text will be invisible\"\n```\n\n### Custom Dictionary\n\nYou can also provide your own dictionary for more control:\n\n```typescript\nimport is, { getDictionary } from 'invisible-strings';\n\n// Get a randomized dictionary\nconst customDictionary = getDictionary();\n\n// Create a new instance with the custom dictionary\nconst { toInvisible, fromInvisible } = is(customDictionary);\n\n// Use the same dictionary to encode and decode\nconst hiddenMessage = toInvisible('Secret message');\nconst visibleMessage = fromInvisible(hiddenMessage);\n```\n\nAlternatively, you can use the helpers directly from the main export:\n\n```typescript\nimport is from 'invisible-strings';\n\n// Access helper functions\nconst customDictionary = is.helpers.getDictionary();\nconst reverseDictionary = is.helpers.getReverseDictionary(customDictionary);\n\n// Create a new instance with the custom dictionary\nconst { toInvisible, fromInvisible } = is(customDictionary);\n```\n\n## API Reference\n\n### Main Export\n\nThe default export is a function that returns an object with the following methods:\n\n```typescript\nis(initialDictionary?: Dictionary) =\u003e {\n  dictionary: Dictionary;\n  toInvisible: (input: string) =\u003e string;\n  fromInvisible: (input: string) =\u003e string;\n  invisible: (strings: TemplateStringsArray, ...values: string[]) =\u003e string;\n  visible: (strings: TemplateStringsArray, ...values: string[]) =\u003e string;\n}\n```\n\n### Helper Functions\n\nThe library provides several helper functions that can be accessed through the main export's `helpers` property:\n\n```typescript\nimport is from 'invisible-strings';\n\n// Access helpers\nconst { getDictionary, getReverseDictionary, toInvisible, fromInvisible, shuffleArray } = is.helpers;\n```\n\nThese helper functions include:\n\n- `getDictionary()` - Creates a new randomized character mapping dictionary\n- `getReverseDictionary(dictionary)` - Reverses a character mapping dictionary\n- `toInvisible(dictionary, input)` - Converts a string to invisible characters using the provided dictionary\n- `fromInvisible(reverseDictionary, input)` - Converts invisible characters back to a normal string\n- `shuffleArray(array)` - Utility function to shuffle an array\n\nFor detailed information about these helpers and how they work, please see the [CONTRIBUTING.md](./CONTRIBUTING.md) file.\n\n## How It Works\n\nInvisible Strings works by:\n\n1. Converting each character in your text to its Unicode character code\n2. Mapping each digit of the character code to a specific invisible Unicode character\n3. Joining these invisible characters with an invisible delimiter\n4. For decoding, the process is reversed\n\nThe library uses various zero-width and other invisible Unicode characters to encode your text. These characters include:\n\n- Zero Width Space\n- Zero Width Non-Joiner\n- Zero Width Joiner\n- Various Unicode whitespace and control characters\n\n## Use Cases\n\n- Watermarking text content\n- Embedding hidden metadata in plain text\n- Creating invisible identifiers\n- Steganography in text\n\n## Browser Compatibility\n\nThis library uses standard JavaScript and Unicode characters, making it compatible with all modern browsers.\n\n## Contributing\n\nContributions are welcome! Please see our [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to contribute, the project structure, and the helper functions implementation details.\n\n## License\n\nMIT © [Yoann Moinet](https://github.com/yoannmoinet)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoannmoinet%2Finvisible-strings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyoannmoinet%2Finvisible-strings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyoannmoinet%2Finvisible-strings/lists"}