{"id":26716611,"url":"https://github.com/javascript-studio/studio-log-x","last_synced_at":"2025-03-27T15:38:02.727Z","repository":{"id":21618065,"uuid":"93312363","full_name":"javascript-studio/studio-log-x","owner":"javascript-studio","description":"❎ x-out confidential data in log entries of a Studio Log stream","archived":false,"fork":false,"pushed_at":"2023-04-18T13:53:36.000Z","size":143,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-09T04:36:10.278Z","etag":null,"topics":["confidential","filter-plugin","logging"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/javascript-studio.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","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":"2017-06-04T12:34:37.000Z","updated_at":"2022-02-12T17:26:12.000Z","dependencies_parsed_at":"2022-08-07T10:00:58.125Z","dependency_job_id":null,"html_url":"https://github.com/javascript-studio/studio-log-x","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-log-x","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-log-x/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-log-x/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/javascript-studio%2Fstudio-log-x/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/javascript-studio","download_url":"https://codeload.github.com/javascript-studio/studio-log-x/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245873105,"owners_count":20686531,"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":["confidential","filter-plugin","logging"],"created_at":"2025-03-27T15:38:02.150Z","updated_at":"2025-03-27T15:38:02.695Z","avatar_url":"https://github.com/javascript-studio.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Studio Log X\n\n❎ X-out confidential data in log entries of a [Studio Log][1] stream.\n\n## Usage\n\n```js\nconst logger = require('@studio/log').out(process.stdout);\nconst logX = require('@studio/log-x');\n\nconst log = logger('app');\nlog.filter(logX('connection.password'));\n\nlog.input('db', { connection: { login: 'admin', password: 'secret' } });\n```\n\nThe above produces this log output:\n\n```json\n{\"ts\":1486630378584,\"ns\":\"app\",\"topic\":\"input\",\"msg\":\"db\",\"data\":{\n  \"connection\":{\"login\":\"admin\",\"password\":\"·····\"}}}\n```\n\nData objects are copied before modification to make it safe to pass object\nreferences as log data.\n\n## Install\n\n```bash\n❯ npm i @studio/log-x\n```\n\n## API\n\n- `x(path...)`: Returns a transform stream in object mode that filters the\n  properties at the given paths.\n- `x(map)`: Maps topic names to filters. The special `*` topic is used if no\n  matching topic filter was specified.\n- `x.ns(ns, path...)`: Like `x(path...)`, but only for the specified namespace.\n- `x.ns(ns, map)`: Like `x(map)`, but only for the specified namespace.\n- `x.all(transform...)`: Combine the given x-out transforms.\n\n\n```js\n// x(map)\nlogX({\n  input: ['connection.user', 'connection.password'],\n  '*': ['token']\n});\n\n// x.ns(ns, path...)\nlogX.ns('Login', 'request.user', 'request.password');\n```\n\n## Supported notations\n\n- `key`: Property access.\n- `key.path`: Property path access.\n- `items[0]`: Array index access.\n- `items[':a']`: Quoted property access.\n- `item.*`: All values in object.\n- `items[*]`: All entries in array.\n- `item.*.key`: Property access in each value of object.\n- `items[*].key`: Property access in each entry of array.\n\n## Related modules\n\n- 👻 [Studio Log][1] logs ndjson to an output stream\n- 📦 [Studio Changes][2] is used to create the changelog for this module.\n\n## License\n\nMIT\n\n\u003cdiv align=\"center\"\u003eMade with ❤️ on 🌍\u003c/div\u003e\n\n[1]: https://github.com/javascript-studio/studio-log\n[2]: https://github.com/javascript-studio/studio-changes\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Fstudio-log-x","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjavascript-studio%2Fstudio-log-x","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjavascript-studio%2Fstudio-log-x/lists"}