Skip to content

bcheidemann/typescript-tracing-compiler-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TypeScript Tracing Compiler Plugin

Example input

instrument: function add(a: number, b: number) {
  return a + b;
}

Example output

/*instrument:*/ function add(a, b) {
  console.log(
    JSON.stringify({
      severity: "TRACE",
      message: "Entering function",
      functionName: "add",
      arguments: { a, b },
    }),
  );
  {
    return a + b;
  }
}

Running the example

$ npm run build -w example
$ npm start -w example
{"severity":"TRACE","message":"Entering function","functionName":"add","arguments":{"a":1,"b":2}}

About

Example TypeScript compiler plugin

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published