Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,19 @@ export class InstrumentationMatcher {
export class Transformer {
private constructor();
free(): void;

/**
* The name of the module to transform.
*/
get moduleName(): string;
Comment thread
timfish marked this conversation as resolved.

/**
* The relative file path within the npm package being instrumented.
*
* @returns {string}
*/
get filePath(): string;

/**
* Transform JavaScript code and optionally sourcemap.
*
Expand Down
18 changes: 18 additions & 0 deletions lib/transformer.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,24 @@ class Transformer {
/** No-op — freeing resources is not needed for the JavaScript implementation. */
free () {}

/**
* The npm package name being instrumented.
*
* @returns {string}
*/
get moduleName () {
return this.#moduleName
}

/**
* The relative file path within the npm package being instrumented.
*
* @returns {string}
*/
get filePath () {
return this.#filePath
}

/**
* Instruments `code` by injecting diagnostics_channel tracing around the
* target functions defined by this transformer's configs.
Expand Down
Loading