Michiel Borkent Michiel Borkent - 1 year ago 60
Node.js Question

REPL session for a ClojureScript library in the vein of `lein try`

Sometimes I want to try out a library in a REPL. For example when I need to know the date 100 days from now, I do:

lein try clj-time
(require '[clj-time.core :as t])
(t/plus (t/today) (t/days 100))

Or with boot:

boot -d clj-time repl -e "(require '[clj-time.core :as t])"
(t/plus (t/today) (t/days 100))

This is already great, but this still has a few seconds of start up time.

My question: can I get the same functionality using ClojureScript and Node and perhaps have a faster startup time? How can I get the example above with cljs-time?

Answer Source

You can use Planck with the jar you're wanting to try by adding it to Planck's "classpath" (it's not an actual classpath since there's no JVM involved). See the Planck Dependencies documentation.


planck -c ~/.m2/repository/com/andrewmcveigh/cljs-time/0.4.0/cljs-time-0.4.0.jar