{"id":20807559,"url":"https://github.com/clo4/redact_json","last_synced_at":"2026-05-08T03:02:42.997Z","repository":{"id":62422314,"uuid":"406983556","full_name":"clo4/redact_json","owner":"clo4","description":"Redact JSON values using code or a CLI (originally part of deno_jamf_school)","archived":false,"fork":false,"pushed_at":"2021-09-16T02:30:23.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-17T18:46:05.659Z","etag":null,"topics":["deno","json","privacy-protection"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/clo4.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":"2021-09-16T01:58:43.000Z","updated_at":"2021-11-12T10:12:41.000Z","dependencies_parsed_at":"2022-11-01T17:33:20.751Z","dependency_job_id":null,"html_url":"https://github.com/clo4/redact_json","commit_stats":null,"previous_names":["separaterecords/redact_json"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fredact_json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fredact_json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fredact_json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clo4%2Fredact_json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clo4","download_url":"https://codeload.github.com/clo4/redact_json/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243152870,"owners_count":20244657,"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":["deno","json","privacy-protection"],"created_at":"2024-11-17T19:38:38.597Z","updated_at":"2025-12-11T21:16:31.959Z","avatar_url":"https://github.com/clo4.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Redact JSON\n\nSuper small Deno library \u0026 CLI to redact JSON. Takes input over stdin, outputs over\nstdout. Doesn't require any permissions.\n\n```bash\ndeno install -qfn redact https://deno.land/x/redact_json/cli.ts\n```\n\n## Using the CLI\n\nThe CLI can output some instructions, along with examples.\n\n```sh\nredact --help\n```\n\n###### POSIX Shell (macOS and Linux)\n\nThis sets the script's stdin to the input file, and stdout to the output file.\n\n```sh\nredact \u003c raw.json \u003e redacted.json\n```\n\n###### PowerShell (Windows)\n\nIn PowerShell, you have to use a cmdlet to read the file and pipe it to the script.\n\n```powershell\nGet-Content raw.json | redact \u003e redacted.json\n```\n\n## Using the library\n\nThere's also a simple example that shows you the input and output.\n\n```\ndeno run https://deno.land/x/redact_json/example.ts\n```\n\nHere's a simple example that's equivalent to the CLI examples above.\n\n`./raw.json` is read, redacted, and written to `./redacted.json`\n\n`redact` is pure, and fully typed. It takes a `JSONValue` and outputs a `JSONValue`. It\nwon't mutate the input value, but for various reasons, that can't be enforced through\nthe type system (yet).\n\n`JSON.parse` returns `JSONFile`, so that can help you with adding types to your\nvariables.\n\n```javascript\nimport { JSONFile, redact } from \"https://deno.land/x/redact_json/mod.ts\";\n\nconst text = await Deno.readTextFile(\"raw.json\");\nconst json = JSON.parse(text) as JSONFile;\n\nconst redacted = redact(json);\n\nconst output = JSON.stringify(redacted);\nawait Deno.writeTextFile(\"redacted.json\", output);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclo4%2Fredact_json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclo4%2Fredact_json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclo4%2Fredact_json/lists"}