Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Keep cmd open after running .exe #644

Closed
vincenthawke opened this issue Mar 12, 2019 · 2 comments
Closed

Keep cmd open after running .exe #644

vincenthawke opened this issue Mar 12, 2019 · 2 comments

Comments

@vincenthawke
Copy link

vincenthawke commented Mar 12, 2019

My .exe closes after finishing its work on windows 10. I would like it to stay open so that the user can read the text output. Is there a way to achieve this by modifying the main script JS file?

Temporarily solved it by wrapping .exe file in another .bat file, but hoped that there was a cleaner, 1-file solution

@Baskiney
Copy link

Baskiney commented Mar 12, 2019

You can edit it in the code by including an iostream. Now you can atleast see the message.

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

console.log("Hello World!")

@vincenthawke
Copy link
Author

You can edit it in the code by including an iostream. Now you can atleast see the message.

const readline = require('readline')

const rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout
})

console.log("Hello World!")

That worked perfectly. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants