I have to run a JavaScript file as an executable to show a dialog with standard buttons from command prompt. I am new to command line programming with java script.
-
I believe you should use Node.js to do that. I also found ShellJS that could help you documentup.com/arturadib/shelljsThiago Custodio– Thiago Custodio2015-02-18 11:31:57 +00:00Commented Feb 18, 2015 at 11:31
-
Try phantomjs, it's a headless browserJohan– Johan2015-02-18 11:43:32 +00:00Commented Feb 18, 2015 at 11:43
-
For Windows Microsoft gave us JScript msdn.microsoft.com/en-us/library/ms692435(v=vs.85).aspxS Meaden– S Meaden2017-05-14 20:57:51 +00:00Commented May 14, 2017 at 20:57
Add a comment
|
2 Answers
Standard Javascript is not something that natively runs in a command line environment. It is designed for use in browsers. However, Node.JS is a framework built to give you this exact feature of running Javascript as a standalone.
It can be downloaded from http://nodejs.org and installed on most platforms.
Once you have it you can invoke your javascript file by running
$ node <your file name here>.js