{"id":21244788,"url":"https://github.com/fiddlydigital/anonimizer","last_synced_at":"2025-03-15T04:25:56.064Z","repository":{"id":176529598,"uuid":"654483400","full_name":"FiddlyDigital/Anonimizer","owner":"FiddlyDigital","description":"A lib to replace and rehydrate sensitive data in text","archived":false,"fork":false,"pushed_at":"2023-09-03T13:32:44.000Z","size":360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-22T01:05:11.906Z","etag":null,"topics":["anonimize","anonymize","data","data-security","prompt","sanitize","string","string-manipulation","text"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/@speakingsoftware/anonimizer","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/FiddlyDigital.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-06-16T08:21:10.000Z","updated_at":"2023-07-18T09:31:32.000Z","dependencies_parsed_at":"2024-11-21T01:40:55.204Z","dependency_job_id":null,"html_url":"https://github.com/FiddlyDigital/Anonimizer","commit_stats":null,"previous_names":["fiddlydigital/anonimizer"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiddlyDigital%2FAnonimizer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiddlyDigital%2FAnonimizer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiddlyDigital%2FAnonimizer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiddlyDigital%2FAnonimizer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FiddlyDigital","download_url":"https://codeload.github.com/FiddlyDigital/Anonimizer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243684478,"owners_count":20330874,"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":["anonimize","anonymize","data","data-security","prompt","sanitize","string","string-manipulation","text"],"created_at":"2024-11-21T01:30:50.332Z","updated_at":"2025-03-15T04:25:56.028Z","avatar_url":"https://github.com/FiddlyDigital.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca name=\"readme-top\"\u003e\u003c/a\u003e\r\n\r\n\u003cdiv align=\"center\"\u003e\r\n  \u003ch1 align=\"center\"\u003eAnonimizer\u003c/h1\u003e\r\n\r\n  \u003cp align=\"center\"\u003e\r\n    A js library used to replace sensitive information in text, and then later to rehydrate that information in derived text.\u003cbr /\u003eThis library works entirely in memory without interacting with any 3rd-party services.\r\n    \u003cbr /\u003e\r\n    \u003ca href=\"https://fiddlydigital.github.io/Anonimizer/\"\u003e\u003cstrong\u003eDeveloper Docs »\u003c/strong\u003e\u003c/a\u003e\r\n    \u003cbr /\u003e\r\n    \u003cbr /\u003e\r\n    \u003ca href=\"https://www.npmjs.com/package/@speakingsoftware/anonimizer\"\u003eView on NPM\u003c/a\u003e\r\n    ·\r\n    \u003ca href=\"https://github.com/FiddlyDigital/Anonimizer/issues\"\u003eReport Bug or Request a Feature\u003c/a\u003e\r\n  \u003c/p\u003e\r\n\u003c/div\u003e\r\n\r\n## Description\r\n\r\nThe intended use is to sanitize input that will be passed to public 3rd-party Services, and then be able to replace the sanitized value in the output with the original safe values. A prime example of this would be creating prompts to send to ChatGPT (or similiar). See Use Case Example below.\r\n\r\n## Usage \r\n### Example\r\n``` js\r\n// Import via ESM\r\nimport { Anonimizer } from '@speakingsoftware/anonimizer'\r\n// or Require via CJS\r\n// const Anonimizer = require('@speakingsoftware/anonimizer').Anonimizer\r\n\r\n// Create instance\r\nconst anonimizer = new Anonimizer();\r\n\r\n/**\r\n * Anonimize\r\n * Pass the string to be sanitize, along as the list of features to be replaced.\r\n * Will return the sanitized version, and a map of what features/values were replaced.\r\n */\r\nconst featuresToReplace = new Array(Features.People, Features.Emails, Features.Urls, Features.HashTags);\r\nlet [safeText, runValueMap] = anonimizer.anonimize(originalInput, featuresToReplace);\r\n\r\n/**\r\n * Rehydrate\r\n * Pass the string to to have the values rehydrated, as well as the map used in the original anonimzation.\r\n * Will return the text with sanitized values replaced with their original values.\r\n */\r\nlet rehydratedText = anonimizer.reHydrate(safeText, runValueMap);\r\n```\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## Example Usecase\r\n\r\nOriginal Prompt:\r\n\r\n\u003e Write an email to Jim, asking them to email Philip at cfo@client.com to call Maria about getting that PO sorted. Also ask about the progress of the #Acquisition Deal.\r\n\r\nSanitized Prompt (via `anonomize` method) safe to send to 3rd/party Service:\r\n\r\n\u003e Write an email to Ava asking them to email Benjamin at safeexample1@example.com to call Charlotte about getting that PO sorted. Also ask about the progress of the #Alligator Deal.\r\n\r\nResponse from 3rd-party Service:\r\n\r\n\u003e Dear Ava,\r\n\u003e I hope this email finds you well. I have an important request on behalf of Charlotte from our team. Charlotte would greatly appreciate it if you could reach out to Benjamin at safeexample1@example.com and ask him to call her regarding the Purchase Order (PO) that needs to be sorted urgently.\r\n\u003e Additionally, Charlotte would like to inquire about the progress and any updates regarding the #Alligator Deal. She would like to stay informed and ensure everything is on track.\r\n\u003e Best Regards,\r\n\r\nContext and values restored, via the `reHydrate` method:\r\n\r\n\u003e Dear Jim, \r\n\u003e I hope this email finds you well. I have an important request on behalf of Maria from our team. Maria would greatly appreciate it if you could reach out to Philip at cfo@client.com and ask him to call her regarding the Purchase Order (PO) that needs to be sorted urgently.\r\n\u003eAdditionally, Maria would like to inquire about the progress and any updates regarding the #Acquisition Deal. She would like to stay informed and ensure everything is on track.\r\n\u003e Best Regards,\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n### From Source\r\n#### Build\r\n``` console\r\nnpm i\r\nnpm run build\r\n```\r\n\r\n#### Test\r\n``` console\r\nnpm run test\r\n```\r\n\r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n\r\n## Warning\r\n\r\nPlease always review the data you store and send to 3rd party systems, to ensure the transit and storage complies with the legal requirements for your jurisdiction, industry and business obligations. The author(s) of this library take no responsibility nor accept any liability for any loss that may occur from either correct or incorrect usage of this library. \r\n\u003cp align=\"right\"\u003e(\u003ca href=\"#readme-top\"\u003eback to top\u003c/a\u003e)\u003c/p\u003e\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiddlydigital%2Fanonimizer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffiddlydigital%2Fanonimizer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffiddlydigital%2Fanonimizer/lists"}