简体   繁体   中英

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 ?

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 .

Eg:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM