0

How can I run code of the javascript outside terminal? I installed nodejs and to the run code javascript I need the terminal. Exist any IDE ti run this code? I use SublimeText to write my code, but I need run it.

Thanks

3 Answers 3

1

You can download atom editor and install a package call platformio-ide-terminal. Then open your .js file as project. In editor below you will observe a plus icon. Just click on the icon your terminal will start responding. Type command node filename.js, you will be able to see console or return value.

editor Link: https://atom.io/ package link: https://atom.io/packages/platformio-ide-terminal

You can go through the documentation if you have any other query.

0

I'm not sure if this is the best solution (or even necessary extra step), but if you make an executable by copying say for example the "calculator" in /usr/share/applications , renaming it, right click, choose properties and change the command (and the icon if you would like by clicking the icon) to /path/to/your/executable.js ... you should now find it among your other software.

or maybe you just need to allow it as executable by right clicking it... who knows :)

0

If you use chmod to mark the file executable, you should be able to create a launcher shortcut for it on your desktop that you can just double-click. You should have an application installed that can execute .is files (I.e. a browser), so the launcher should open it in one of them.

I'm not familiar with SublimeText, but if you're using the terminal at all, it would probably be more convenient for you to just create an alias or a function that executes your file:

alias go=chromium-browser myfile.js

Used like:

go

Or

function go() { chromium-browser $@; }

Used like:

go differentFile.js

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .