Recently I've started writing Node.js and got to fiddle my way through configuring my Atom install to automatically run my Node.js code for me.
Installing Node.js
You can install Node.js using nvm (Node Version Manager) or you can download it from the official site.
I recommend using nvm to keep your version of Node.js up to date. To install the current stable version of Node.js on Ubuntu you can use the following command: Pro sound studio.
- There are mainly two ways to install packages for Atom: Enter apm install package-name on your terminal. Obviously, the Atom package manager, apm, must be installed (you can enter apm to verify installation). Open Atom and go to edit preferences install and then search for the package you want to install.
- Atom, a text editor developed by github, keeping every programmers capacity in mind. From beginner level programmers to super nerds atom is the perfect one for all. Approachable, modern yet hackable to the core & one can customize it according to the need, everything a nerd may ask for in a text editor.
sudo apt-get install nodejs
Installing Atom
It is a JavaScript and Typescript IDE at heart. It has excellent support for Cordova, Ionic, React, React Native, Angular, Node.js, Vue.js, and other popular JavaScript frameworks. By the way, we have already covered Vue.js in greater detail here.
Atom is a text editor created by the people behind Github, you can download it from it's homepage: https://atom.io/
If you're on Ubuntu you can install (using WebUpd8 PPA) like so:
With Node.js and Atom installed, we can configure Atom to run our Node.js for us!
Configuring Atom to run Node.js
Because I'm a lazy sod, I'd rather write my code in Atom, then run it in Atom. Alt-tabbing is sooo early-2000s.
So what we want to do is install the package atom-runner. To do this we need to open Atom and then go to: Edit -> Preferences -> Install -> Packages. Then we search for atom-runner, and install it.
Atom Programming Ide
Now we need to edit our config file for Atom, open ~/.atom/config.cson
where ~
is your home directory. Now paste the below (starting with one indentation, as below):
If you're on Ubuntu, you need to add js:'nodejs'
. Ubuntu is the only OS (that I know of, at least!) that has a different default package name for Node.js.
Ready to go!
After completing the above you should now be reading to go! So let's open a blank js file and paste in console.log('I can run Node.js from within Atom!')
and save the file. Now use Alt + R
to run your file, the output should come out in a new tab like so:
Atom Ide For Node Js Java
That's all for now, I'll be back soon with another post so stay tuned. I really am feeling Japan for next time!