First of all lets check up does NodeJS already installed on our host:
nodejs --version
v0.10.25
In order to use JS inside Babel you’ll need to activate its support. Find
in your .emacs
or .init
strings with Babel’s supported languages:
(org-babel-do-load-languages
'org-babel-load-languages
'((python . t)
(emacs-lisp . t)
(shell . t)
(js . t)
(ditaa . t)
(plantuml . t)
(sqlite . t)
))
and ensure that JS is already included. Otherwise you should add the necessary
string and evaluate the region by marking it C-SPC
and execution M-x eval-region
Try to copy and paste code snippet below into your org
file and evaluate it
by yourself. Put the pointer between #+BEGIN_SRC
and #+END_SRC
and type C-c C-c
to get results.
console.log("Hello World!");
#+END_SRC
#+RESULTS:
: Hello World!
Have a fun