Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We need types definitions for typescript support #48

Closed
zlydenko opened this issue Jun 30, 2019 · 1 comment · Fixed by #70
Closed

We need types definitions for typescript support #48

zlydenko opened this issue Jun 30, 2019 · 1 comment · Fixed by #70

Comments

@zlydenko
Copy link

No description provided.

@jswalden
Copy link

You can work around this by putting a why-is-node-running.d.ts file within your project, in a place where your tsconfig.json will instruct that it be compiled, and fill it with these contents:

interface WithConsoleErrorStyleMethod {
	error: Console['error']
}

declare module 'why-is-node-running' {
	export default function log(logger?: WithConsoleErrorStyleMethod): void
}

Then import whyIsNodeRunning from 'why-is-node-running' and do whyIsNodeRunning() to trigger the dumping using console.error -- or pass your own object with a 'error' property that behaves like console.error does, if you want to do something cuter.

jonkoops added a commit to jonkoops/why-is-node-running that referenced this issue Jul 8, 2024
jonkoops added a commit to jonkoops/why-is-node-running that referenced this issue Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants