From mboxrd@z Thu Jan 1 00:00:00 1970 From: tsd@tsdye.com (Thomas S. Dye) Subject: Re: how to evaluate javascript in code blocks Date: Tue, 01 Jan 2013 19:13:29 -1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:40669) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TqGeP-0004vU-Rl for emacs-orgmode@gnu.org; Wed, 02 Jan 2013 00:14:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TqGeO-00031G-RK for emacs-orgmode@gnu.org; Wed, 02 Jan 2013 00:14:01 -0500 Received: from oproxy12-pub.bluehost.com ([50.87.16.10]:43982) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1TqGeO-00030w-HI for emacs-orgmode@gnu.org; Wed, 02 Jan 2013 00:14:00 -0500 In-Reply-To: (dougie smith's message of "Tue, 1 Jan 2013 14:55:43 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: dougie smith Cc: emacs-orgmode@gnu.org dougie smith writes: > i have installed nodejs > not sure what to do next > > do i need an 'ob.javascript file? > > can't seem to find any docs. AFAIK, the only documentation is in the file ob-js.el. Back in 2011, Eric Schulte welcomed patches to ob-js.el to support sessions with node. I don't think there has been any subsequent work on this front. You'll need something like this in .emacs: (org-babel-do-load-languages 'org-babel-load-languages '((js . t))) If you evaluate the following source code block, you can look at localhost:8888 and see Hello World. But, emacs is fully engaged until you press Ctrl-G. #+begin_src js :tangle hello.js var http = require("http"); http.createServer(function(request, response) { response.writeHead(200, {"Content-Type": "text/plain"}); response.write("Hello World"); response.end(); }).listen(8888); #+end_src hth, Tom -- Thomas S. Dye http://www.tsdye.com