Skip to content

Commit bceade1

Browse files
committed
isnpect
1 parent 3092d39 commit bceade1

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
],
1111
"scripts": {
1212
"build": "tsc",
13-
"worker": "ts-node -T ./runner.ts",
13+
"worker": "node --inspect -r ts-node/register/transpile-only ./runner.ts",
1414
"migration-add": "migrate-mongo create",
1515
"migrate:up": "migrate-mongo up",
1616
"migrate:down": "migrate-mongo down",

runner.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@ dotenv.config();
1515
type WorkerConstructor = new () => Worker;
1616

1717
const BEGINNING_OF_ARGS = 2;
18+
const INSPECT_FLAG_PATTERN = /^--inspect(?:-brk)?(?:=.*)?$/;
1819
/**
1920
* Get worker name(s) from command line arguments
2021
*
2122
* @example ts-node runner.ts hawk-worker-javascript
2223
* @example ts-node runner.ts hawk-worker-javascript hawk-worker-nodejs
2324
*/
24-
const workerNames = process.argv.slice(BEGINNING_OF_ARGS);
25+
const workerNames = process.argv
26+
.slice(BEGINNING_OF_ARGS)
27+
.filter((argument) => !INSPECT_FLAG_PATTERN.test(argument));
2528

2629
/**
2730
* Initialize HawkCatcher

0 commit comments

Comments
 (0)