{"id":13594808,"url":"https://github.com/recurser/string-is","last_synced_at":"2025-10-07T01:03:16.859Z","repository":{"id":37035069,"uuid":"413830263","full_name":"recurser/string-is","owner":"recurser","description":"An open-source, privacy-friendly online string toolkit for developers.","archived":false,"fork":false,"pushed_at":"2025-04-10T20:36:57.000Z","size":8533,"stargazers_count":268,"open_issues_count":12,"forks_count":19,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T19:49:10.080Z","etag":null,"topics":["nextjs","react","reactjs","typescript","vercel"],"latest_commit_sha":null,"homepage":"https://string.is","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/recurser.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-05T13:30:27.000Z","updated_at":"2025-04-09T11:20:04.000Z","dependencies_parsed_at":"2023-10-12T14:50:25.899Z","dependency_job_id":"e85e1a18-bc0d-48b5-be7f-518340df0d14","html_url":"https://github.com/recurser/string-is","commit_stats":{"total_commits":1527,"total_committers":4,"mean_commits":381.75,"dds":0.3182711198428291,"last_synced_commit":"5604f258759d0ef2123bdeb8de3d82209287a08e"},"previous_names":[],"tags_count":73,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recurser%2Fstring-is","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recurser%2Fstring-is/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recurser%2Fstring-is/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/recurser%2Fstring-is/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/recurser","download_url":"https://codeload.github.com/recurser/string-is/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248625501,"owners_count":21135513,"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":["nextjs","react","reactjs","typescript","vercel"],"created_at":"2024-08-01T16:01:39.433Z","updated_at":"2025-10-07T01:03:11.824Z","avatar_url":"https://github.com/recurser.png","language":"TypeScript","funding_links":[],"categories":["nextjs","TypeScript"],"sub_categories":[],"readme":"# string-is\n\n![eslint](https://github.com/recurser/string-is/actions/workflows/eslint.yml/badge.svg)\n![jest](https://github.com/recurser/string-is/actions/workflows/jest.yml/badge.svg)\n![build](https://github.com/recurser/string-is/actions/workflows/build.yml/badge.svg)\n[![codecov](https://codecov.io/gh/recurser/string-is/branch/develop/graph/badge.svg?token=1G0J9SSRDX)](https://codecov.io/gh/recurser/string-is)\n\n[string.is](https://www.string.is/) is an open-source, privacy-friendly toolkit for developers. You can see it in action [here](https://www.string.is/).\n\n![Screenshot](src/images/screenshot.png)\n\nstring.is is an opinionated conversion tool, with the following goals:\n\n- It should be open-source.\n- It should not set any cookies.\n- It should have a strict Content Security Policy.\n- It should be extremely opinionated about dependancies, and only use well-known, well-supported libraries.\n- It should try to detect the format of the input, and intelligently choose output options.\n\n\n## Browser Support\n\nstring.is has been confirmed to work on Chrome, Safari, Firefox, and Edge. Internet explorer is not supported.\n\n\n## Running locally\n\nInstall dependencies:\n\n```bash\nyarn install\n```\n\nSet up git hooks:\n\n```bash\nyarn husky install\n```\n\nRun the development server:\n\n```bash\nyarn dev\n```\n\n... and then open [http://localhost:3000](http://localhost:3000) in your browser.\n\nTo run all linting checks, type checks, tests, and build for production:\n\n```bash\nyarn all\n```\n\n\n## Running with Docker\n\nBuild the docker image:\n\n```bash\nyarn docker-build\n```\n\nor\n\n```bash\ndocker build -t string-is .\n```\n\n... and then run it:\n\n```bash\nyarn docker-run\n```\n\nor\n\n```bash\ndocker run -p 3000:3000 string-is\n```\n\nAlternatively you can build and run it with `docker-compose`:\n\n```bash\ndocker-compose up\n```\n\n... or even run it directly from [Docker Hub](https://hub.docker.com/r/daveperrett/string-is/tags):\n\n```bash\ndocker run -p 3000:3000 daveperrett/string-is:latest\n````\n\nCurrently `linux/arm64` and `linux/amd64` platforms are supported.\n\n\n## Adding a new converter\n\nThe `src/lib` folder contains most of the conversion logic, and is pure TypeScript, with no React knowledge required.\n\n- `src/lib/identities` contains *identifiers* that take an input string and return the confidence level that the input is in a particular format. For example, `JwtIdentifier` returns a number indicating the confidence level (between 0 and 100) that a given input string is a JWT token.\n- `src/lib/inputs` contains parsers that load strings from different formats. For example, the `JsonInput` parses a JSON string and returns an object.\n- `src/lib/outputs` takes parsed data and formats it into a specific output format. For example, `JavaScriptOutput` takes a JavaScript string, formats it according to the formatting options provided, and returns the result.\n- `src/lib/converters` are *input* → *output* pairs - the glue that performs a conversion between formats. For example, `CsvToJsonConverter` takes a CSV string as input, feeds it into the `CsvInput` for parsing, and pipes the result into the `JsonOutput` for formatting.\n\nTo add a new converter:\n\n1. Decide what formats you are converting *from* and *to*. As an example, let's pretend you are writing a converter *from* plain text *to* reversed-text.\n2. Check that there is an `identity` (under [src/lib/identities](https://github.com/recurser/string-is/tree/develop/src/lib/identities)) for the *from* format. In this case we are converting from plain text, and we already have a [PlainIdentity](https://github.com/recurser/string-is/tree/develop/src/lib/identities/PlainIdentity.ts), so we don't need to add a new identity. An `identity` should export (a) a `confidence` function which, given an input string, returns a number out of 100 describing the confidence that the given input matches the identity, and (b) an array of `converters` that the identity can be used with.\n3. If you added a new `identity` in step (2), make sure to export it in [src/lib/identities/index.ts](https://github.com/recurser/string-is/tree/develop/src/lib/identities/index.ts).\n4. Check that there is an `output` (under [src/lib/outputs](https://github.com/recurser/string-is/tree/develop/src/lib/outputs)) for the *to* format. An output should should export an `output` function which, given an input string (or possibly object, depending on the conversion taking place) and an `options` object, will convert the input into the desired output string.\n5. If you added a new `output` in step (4), make sure to export it in [src/lib/outputs/index.ts](https://github.com/recurser/string-is/tree/develop/src/lib/outputs/index.ts).\n6. Add a new `converter` (under [src/lib/converters](https://github.com/recurser/string-is/tree/develop/src/lib/converters)) for the `input` + `output` pair. A converter should export (a) an `operation` function which passes the input string and an `options` object to the appropriate `output`, and (b) an `outputId`, which defines which output is being used.\n7. If you added a new `converter` in step (6), make sure to export it in [src/lib/converters/index.ts](https://github.com/recurser/string-is/tree/develop/src/lib/converters/index.ts). Also make sure to add entries to [locales/en/pages-converter.json](https://github.com/recurser/string-is/blob/develop/locales/en/pages-converter.json)] so that the auto-generated landing page will have the correct heading, intro text and example.\n8. If you defined a new `outputId` in step (6), add a React output component (under [src/components/domain/convert/outputs](https://github.com/recurser/string-is/tree/develop/src/components/domain/convert/outputs)) to render the new kind of output. If you are re-using an existing kind of output (eg. converting to JSON or YAML) you can re-use an existing output component here.\n9. If you added a new React component in step (8), make sure to export it in [src/components/domain/convert/outputs](https://github.com/recurser/string-is/tree/develop/src/components/domain/convert/outputs/index.ts).\n\nIf the appropriate `inputs`, `outputs`, `converters` and React components are in place and exported correctly, you should be able to use your new converter, given the appropriate input string that triggers a non-zero `confidence`.\n\n\n## Deployment\n\nIf you want to be 100% confident that your privacy is protected, you can easily set up a string.is instance for your own personal or organizational use.\n\nThe quickest way to deploy string.is is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template\u0026filter=next.js) (it's free for non-commercial use). Check out their [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. Click the `Deploy` button below to deploy this application with Vercel:\n\n[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https%3A%2F%2Fgithub.com%2Frecurser%2Fstring-is\u0026project-name=string-is\u0026repository-name=string-is)\n\n[Netlify](https://www.netlify.com/with/nextjs/) and [Heroku](https://elements.heroku.com/buildpacks/mars/heroku-nextjs) are also good options for free hosting. Click the `Deploy` button below to deploy this application with Heroku:\n\n[![Deploy with Heroku](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/recurser/string-is)\n\nUnfortunately string.is doesn't currently support static builds via `next export` (which would allow hosting on eg. S3), because the `i18n` feature it uses is not currently supported for static builds.\n\n### Deploy string.is under a sub-path of a domain\n\nSet the `NEXT_PUBLIC_BASE_PATH` environment variable to the sub-path, then build the project before deploying. This value must be set at build time and cannot be changed without re-building as the value is inlined in the client-side bundles.\n\nFor example, if you're deploying to `https://tools.example.com/string-is`, you'll need to set `NEXT_PUBLIC_BASE_PATH` to `/string-is`. You don't need to set this variable if you're deploying to the root of a domain.\n\nBuild and run with Docker:\n\n```bash\ndocker build -t string-is --build-arg NEXT_PUBLIC_BASE_PATH=\"/string-is\" .\ndocker run -p 3000:3000 string-is\n```\n\nOr build and run with `docker-compose`:\n\n```bash\nexport NEXT_PUBLIC_BASE_PATH=\"/string-is\"\ndocker-compose up --build\n```\n\n## Localization\n\nstring.is supports full localization. New languages should be added under the `locales/` folder in JSON format (see `locales/en/` for an example). English is currently the only locale provided, but support for new languages is welcome.\n\n\n## Analytics\n\nstring.is includes support for [Plausible Analytics](https://plausible.io/), a privacy-friendly, cookie-less analytics service. To enable it, set an environment variable specifying the domain:\n\n```\nNEXT_PUBLIC_ANALYTICS_DOMAIN=string.is\n```\n\nAnalytics is disabled by default unless `process.env.NODE_ENV === 'production'` and a `NEXT_PUBLIC_ANALYTICS_DOMAIN` domain is set.\n\n\n## Contributing\n\nOnce you've made your changes:\n\n1. [Fork](http://help.github.com/fork-a-repo/) string-is\n2. Create a topic branch - `git checkout -b feature/add-my-new-converter`\n3. Push to your branch - `git push origin feature/add-my-new-converter`\n4. Create a [Pull Request](http://help.github.com/pull-requests/) from your branch\n5. That's it!\n\n\n## Author\n\n[@davemetrics](http://twitter.com/davemetrics)\n\n\n## Licensing\n\nSee the [LICENSE](https://github.com/recurser/string-is/blob/develop/LICENSE) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecurser%2Fstring-is","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frecurser%2Fstring-is","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frecurser%2Fstring-is/lists"}