First of all lets check up does NodeJS already installed on our host:
In order to use JS inside Babel you'll need to activate its support. Find
.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
Try to copy and paste code snippet below into your
org file and evaluate it
by yourself. Put the pointer between
C-c C-c to get results.
#+BEGIN_SRC js :cmd "nodejs" :results output console.log("Hello World!"); #+END_SRC #+RESULTS: : Hello World!
Have a fun
blog comments powered by Disqus