{"id":20390679,"url":"https://github.com/dizmo/functions-trace","last_synced_at":"2025-03-05T00:12:47.529Z","repository":{"id":51261739,"uuid":"148331972","full_name":"dizmo/functions-trace","owner":"dizmo","description":"dizmoFun: method invocation tracer","archived":false,"fork":false,"pushed_at":"2023-10-18T13:42:49.000Z","size":1256,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2024-04-27T15:22:19.716Z","etag":null,"topics":["dizmo","function","invocation","javascript","library","tracer","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dizmo.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,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-09-11T14:38:43.000Z","updated_at":"2022-11-16T19:25:06.000Z","dependencies_parsed_at":"2023-12-26T09:04:50.254Z","dependency_job_id":"b26bae40-12b3-46b4-92a1-27fe00cb1f53","html_url":"https://github.com/dizmo/functions-trace","commit_stats":{"total_commits":46,"total_committers":2,"mean_commits":23.0,"dds":0.04347826086956519,"last_synced_commit":"2421e1c06e615e60caa44f9e1cbb1bb4abfd0645"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizmo%2Ffunctions-trace","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizmo%2Ffunctions-trace/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizmo%2Ffunctions-trace/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dizmo%2Ffunctions-trace/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dizmo","download_url":"https://codeload.github.com/dizmo/functions-trace/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241940579,"owners_count":20045883,"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":["dizmo","function","invocation","javascript","library","tracer","typescript"],"created_at":"2024-11-15T03:26:16.444Z","updated_at":"2025-03-05T00:12:47.508Z","avatar_url":"https://github.com/dizmo.png","language":"TypeScript","readme":"[![NPM version](https://badge.fury.io/js/%40dizmo%2Ffunctions-trace.svg)](https://npmjs.org/package/@dizmo/functions-trace)\n[![Build Status](https://travis-ci.com/dizmo/functions-trace.svg?branch=master)](https://travis-ci.com/dizmo/functions-trace)\n[![Coverage Status](https://coveralls.io/repos/github/dizmo/functions-trace/badge.svg?branch=master)](https://coveralls.io/github/dizmo/functions-trace?branch=master)\n\n# @dizmo/functions-trace\n\nProvides a `@trace` decorator, which traces each method invocation for all methods of a class via a global `CONSOLE` object, which is by default is the standard `console`. Further, a `@traceable` decorator is provided, which can selective enable (or disable) the tracing of a particular class method.\n\nTracing is applied *only*, when the global `TRACE` variable is set to `true`. It is also possible to set `TRACE` to a number, in which case tracing is deferred by the corresponding amount of milliseconds. Also, setting it to `0` will imply, that the invocations will be logged as soon as possible - however still asynchronously.\n\n## Usage\n\n### Install\n\n```sh\nnpm install @dizmo/functions-trace --save\n```\n\n### Require\n\n```javascript\nconst { trace, traceable } = require('@dizmo/functions-trace');\n```\n\n### Examples\n\n```typescript\nimport { trace, traceable } from '@dizmo/functions-trace';\n```\n\n```typescript\n@trace /* or: @trace(true|false) */\nclass MyClass {\n\n    // @traceable\n    public method_1() {}\n\n    // @traceable(true)\n    public method_2() {}\n\n    @traceable(false)\n    public method_3() {}\n}\n```\n\n```typescript\nimport { Global } from '@dizmo/functions-trace';\n```\n\n```typescript\ndeclare const global: Global;\nglobal.TRACE = true; // or e.g. `200` milliseconds\n```\n\n## Development\n\n### Clean\n\n```sh\nnpm run clean\n```\n\n### Build\n\n```sh\nnpm run build\n```\n\n#### without linting and cleaning:\n\n```sh\nnpm run -- build --no-lint --no-clean\n```\n\n#### with UMD bundling (incl. minimization):\n\n```sh\nnpm run -- build --prepack\n```\n\n#### with UMD bundling (excl. minimization):\n\n```sh\nnpm run -- build --prepack --no-minify\n```\n\n### Lint\n\n```sh\nnpm run lint\n```\n\n#### with auto-fixing:\n\n```sh\nnpm run -- lint --fix\n```\n\n### Test\n\n```sh\nnpm run test\n```\n\n#### without linting, cleaning and (re-)building:\n\n```sh\nnpm run -- test --no-lint --no-clean --no-build\n```\n\n### Cover\n\n```sh\nnpm run cover\n```\n\n#### without linting, cleaning and (re-)building:\n\n```sh\nnpm run -- cover --no-lint --no-clean --no-build\n```\n\n## Documentation\n\n```sh\nnpm run docs\n```\n\n## Publish\n\n```sh\nnpm publish\n```\n\n#### initially (if public):\n\n```sh\nnpm publish --access=public\n```\n\n## Copyright\n\n © 2020 [dizmo AG](http://dizmo.com/), Switzerland\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizmo%2Ffunctions-trace","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdizmo%2Ffunctions-trace","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdizmo%2Ffunctions-trace/lists"}