{"_id":"@aiteq/trace","_rev":"1-329b735f2d59f268ccc6ae2d96ca013b","name":"@aiteq/trace","description":"TypeScript decorator to trace method calls","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@aiteq/trace","version":"1.0.0","description":"TypeScript decorator to trace method calls","main":"./dist/index.js","types":"./dist/index.d.ts","scripts":{"compile":"tsc -p .","prepublish":"npm run compile"},"repository":{"type":"git","url":"git+https://github.com/aiteq/trace.git"},"keywords":["typescript","debug","trace"],"author":{"name":"Aiteq Reloaded, s.r.o."},"license":"MIT","bugs":{"url":"https://github.com/aiteq/trace/issues"},"homepage":"https://github.com/aiteq/trace#readme","devDependencies":{"@types/debug":"0.0.29","@types/node":"^7.0.23","typescript":"^2.3.2"},"dependencies":{"debug":"^2.6.8"},"files":["dist/index.js","dist/index.d.ts"],"gitHead":"1291dc8b9889b0778b47cea7f8b4f5e2f9e6ddf0","_id":"@aiteq/trace@1.0.0","_npmVersion":"5.0.1","_nodeVersion":"7.10.0","_npmUser":{"name":"darbic","email":"tomas.klima@aiteq.com"},"dist":{"integrity":"sha512-rmd3TKw2DtxdXIfBbquTo8oAYAtoUt6bCsn/YUk6xI4N9JDPeGqgN5WZszvApVQPYOmkXoosR1/ASJj7JLzOJA==","shasum":"25dde33e6117a19aa8fca497ff7dd8172bb2a9bf","tarball":"https://registry.npmjs.org/@aiteq/trace/-/trace-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCxgpR2oYXJuKqsZGPXOz1IW4SegM8QHSpbMaY+DYPMNwIhANYJS/GtWet77Wad4dncrUdx13bIKQLzScat2eOdSmL5"}]},"maintainers":[{"name":"darbic","email":"tomas.klima@aiteq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/trace-1.0.0.tgz_1496443694392_0.09071208816021681"}}},"readme":"# trace\nTypeScript decorator to trace method calls using https://github.com/visionmedia/debug\n\n## Usage\nThe `Trace` decorator can be used for a class as well as for a method.\n\n### Decorating a class:\n```ts\nimport { Trace } from \"@aiteq/trace\";\n\n@Trace()\nclass User {\n  constructor(public name: string) { }\n  \n\tpublic getName(): string {\n\t\treturn this.name;\n\t}\n  \n  public toString(): string {\n    return this.getName();\n  }\n}\n\nconsole.log(new User(\"Honza\").toString());\n```\nThe output would look like this:\n```\n> DEBUG=* node ./dist/trace-test.js\n\n  TRACE => User.toString() +0ms\n  TRACE => User.getName() +5ms\n  TRACE <= User.getName: Honza +6ms\n  TRACE <= User.toString: Honza +7ms\nHonza\n```\n\n### Decorating a method:\n```ts\nimport { Trace } from \"@aiteq/trace\";\n\nclass User {\n  constructor(public name: string) { }\n  \n  @Trace()\n\tpublic getName(): string {\n\t\treturn this.name;\n\t}\n  \n  public toString(): string {\n    return this.getName();\n  }\n}\n\nconsole.log(new User(\"Honza\").toString());\n```\nThe output would look like this:\n```\n> DEBUG=* node ./dist/trace-test.js\n\n  TRACE => User.getName() +0ms\n  TRACE <= User.getName: Honza +5ms\nHonza\n```\n\n### Notes\nThe ouput will be colorized by `debug`.\n\nTracing doesn't work for constructor.\n","maintainers":[{"name":"darbic","email":"tomas.klima@aiteq.com"}],"time":{"modified":"2022-04-04T12:24:12.762Z","created":"2017-06-02T22:48:15.312Z","1.0.0":"2017-06-02T22:48:15.312Z"},"homepage":"https://github.com/aiteq/trace#readme","keywords":["typescript","debug","trace"],"repository":{"type":"git","url":"git+https://github.com/aiteq/trace.git"},"author":{"name":"Aiteq Reloaded, s.r.o."},"bugs":{"url":"https://github.com/aiteq/trace/issues"},"license":"MIT","readmeFilename":"README.md"}