2

I'm using ts-node to execute scripts written in TypeScript. I would like to inspect a flamegraph using 0x. Here is the current command I'm executing with ts-node:

> ts-node -r tsconfig-paths/register scripts/my-script.ts

How would I use 0x to capture a flamegraph of the scripts execution? Or, is there another way to capture a flamegraph of the executed code?

Craig Smitham
  • 3,395
  • 4
  • 31
  • 38

1 Answers1

5

There is an option for passing arguments to node using flamegraph.

Pass custom arguments to node:

0x -- node --zero-fill-buffers my-app.js

So in your case, you can try:

0x -- node -r ts-node/register -r tsconfig-paths/register scripts/my-script.ts