Created
February 4, 2021 09:07
-
-
Save CMCDragonkai/5473305655a76374cd2bc2b0a48ccc82 to your computer and use it in GitHub Desktop.
Synchronous and Asynchronous Node.js Scripts #nodejs #javascript
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
#!/usr/bin/env node | |
import process from 'process'; | |
async function main(argv = process.argv): Promise<number> { | |
process.exitCode = 0; | |
return process.exitCode; | |
} | |
if (require.main === module) { | |
(async () => { | |
await main(); | |
})(); | |
} | |
export default main; |
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
#!/usr/bin/env node | |
import process from 'process'; | |
function main(argv = process.argv): number { | |
process.exitCode = 0; | |
return process.exitCode; | |
} | |
if (require.main === module) { | |
main(); | |
} | |
export default main; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment