-
-
Save AnthonyLzq/f5059d1478cd99936ad572c4284004a5 to your computer and use it in GitHub Desktop.
Use global variable in Node.js <= 14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { CustomNodeJSGlobal } from "/direction/to/global.variables/file" | |
declare const global: CustomNodeJSGlobal | |
global.myGlobalVariable = 'Hi mom, look at me, I am global!' | |
console.log({ myGlobalVariable: global.myGlobalVariable }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment