Skip to content
Discussion options

You must be logged in to vote

The simplest, and arguably cleanest, would be to just import them. Why not do this, just out of curiosity?

If you really want to do that, you'll have to use the "global" object (which is like "window" in the browser) and assign your functions to it.

The problem with this is that you'll lose the typing, and you'll have to tell Typescript that these functions exist elsewhere.

https://stackoverflow.com/questions/29544417/nodejs-global-functions
https://stackoverflow.com/questions/35074713/extending-typescript-global-object-in-node-js

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@wemersonrv
Comment options

Answer selected by wemersonrv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants