Skip to content

Instantly share code, notes, and snippets.

@cemerick
Created April 26, 2015 01:12
Show Gist options
  • Save cemerick/6785f92dd450384e7917 to your computer and use it in GitHub Desktop.
Save cemerick/6785f92dd450384e7917 to your computer and use it in GitHub Desktop.
using cljs.jar + nREPL + piggieback
chas@t440p:~/Downloads$ java -cp cljs.jar:/home/chas/.m2/repository/org/clojure/tools.nrepl/0.2.10/tools.nrepl-0.2.10.jar:/home/chas/.m2/repository/com/cemerick/piggieback/0.2.1/piggieback-0.2.1.jar clojure.main nrepl_piggieback.clj &
nREPL server running on port 7888
# using Leiningen here _only_ to connect to the running nREPL server
# any nREPL client will do
chas@t440p:~/Downloads$ lein repl :connect 7888
Connecting to nREPL at 127.0.0.1:7888
REPL-y 0.3.5, nREPL 0.2.10
Clojure 1.7.0-beta1
Java HotSpot(TM) 64-Bit Server VM 1.8.0_40-b25
Docs: (doc function-name-here)
(find-doc "part-of-name-here")
Source: (source function-name-here)
Javadoc: (javadoc java-object-or-class-here)
Exit: Control+D or (exit) or (quit)
Results: Stored in vars *1, *2, *3, an exception in *e
user=> (require 'cljs.repl.node)
nil
user=> (cemerick.piggieback/cljs-repl (cljs.repl.node/repl-env))
ClojureScript Node.js REPL server listening on 58592
To quit, type: :cljs/quit
nil
cljs.user=> #()
#<function (){
return cljs.core.List.EMPTY;
}>
(require '[clojure.tools.nrepl.server :as server]
'[cemerick.piggieback :as pb])
(server/start-server
:handler (server/default-handler #'pb/wrap-cljs-repl)
:port 7888)
(println "nREPL server running on port 7888")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment