{"id":18030464,"url":"https://github.com/danielkucal/ts-debug","last_synced_at":"2025-03-27T03:31:21.361Z","repository":{"id":57380644,"uuid":"93457761","full_name":"DanielKucal/ts-debug","owner":"DanielKucal","description":"Console that logs where you want. Written in TypeScript ♥","archived":false,"fork":false,"pushed_at":"2022-03-01T11:22:15.000Z","size":19,"stargazers_count":2,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-18T15:11:46.394Z","etag":null,"topics":["angular","console","debugger","debugging-tool","javascript","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/ts-debug","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/DanielKucal.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-06-06T00:05:48.000Z","updated_at":"2023-01-01T10:47:20.000Z","dependencies_parsed_at":"2022-09-26T16:41:19.169Z","dependency_job_id":null,"html_url":"https://github.com/DanielKucal/ts-debug","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/DanielKucal%2Fts-debug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielKucal%2Fts-debug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielKucal%2Fts-debug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DanielKucal%2Fts-debug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DanielKucal","download_url":"https://codeload.github.com/DanielKucal/ts-debug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245778719,"owners_count":20670682,"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":["angular","console","debugger","debugging-tool","javascript","typescript"],"created_at":"2024-10-30T09:14:21.085Z","updated_at":"2025-03-27T03:31:21.072Z","avatar_url":"https://github.com/DanielKucal.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typescript Debugger\n## Console Wrappper\nThis tiny lib written in Typescript allows you to leave your debugging logs inside your project without worries of removing them for production environment.\n\n### Installation\n```\nnpm install --save ts-debug\n```\n\n### Usage\n`Debugger`'s instance has the exactly same methods as standard `console`. Its constructor takes 3 parameters: \n  + `console: Console` - object implementing Console interface, e.g. `console` or its wrapper\n  + `isEnabled: boolean = true` - determines if Debugger should be enabled (you shoud pass here `false` to prevent displaying console output in production environment)\n  + `prefix: string = ''` - specifies prefix for console outputs, e.g. `\"[DEBUG] \"`\n\n#### Example:\n```\nimport { Debugger } from 'ts-debug';\nconst Config = { isProd: false }; // example config in your application\n\nconst debug = new Debugger(console, !Config.isProd, '[DEBUG] ');\ndebug.log('Debugger is enabled!');\ndebug.warn('An error occured while processing: ', { example: 'object' });\n```\n\nYou can see real-life usage of this lib in [ngx-store](https://github.com/zoomsphere/ngx-store).\n\n\n### Additional methods\n- `throw(error: Error)` - throws usual (sync) error in debug mode and non-blocking (async) otherwise\n\n\n### Compatibility\nFor TypeScript 3+ use v1.3+\nFor older versions use v1.2","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielkucal%2Fts-debug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanielkucal%2Fts-debug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanielkucal%2Fts-debug/lists"}