From f3e92ad0a4411f83f4eac2ed6e7181869e9fbdc6 Mon Sep 17 00:00:00 2001 From: "Diego B. Fernandez" Date: Wed, 23 Dec 2020 14:59:36 +0100 Subject: [PATCH] clj: add page (#4980) * clj: add page * Update pages/common/clj.md * Update clj.md * Update clj.md * Apply suggestions from code review Co-authored-by: Starbeamrainbowlabs * Apply suggestions from code review Co-authored-by: Starbeamrainbowlabs Co-authored-by: Starbeamrainbowlabs --- pages/common/clj.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pages/common/clj.md diff --git a/pages/common/clj.md b/pages/common/clj.md new file mode 100644 index 000000000..051b176ff --- /dev/null +++ b/pages/common/clj.md @@ -0,0 +1,29 @@ +# clj + +> Clojure tool to start a REPL or invoke a specific function with data. +> All options can be defined in a `deps.edn` file. +> More information: . + +- Start a REPL: + +`clj` + +- Execute a function: + +`clj -X {{namespace/function_name}}` + +- Run the main function of a specified namespace: + +`clj -M -m {{namespace}} {{args}}` + +- Prepare a project by resolving dependencies, downloading libraries, and making / caching classpaths: + +`clj -P` + +- Start an nREPL server with the CIDER middleware: + +`clj -Sdeps '{:deps {nrepl {:mvn/version "0.7.0"} cider/cider-nrepl {:mvn/version "0.25.2"}}}' -m nrepl.cmdline --middleware '["cider.nrepl/cider-middleware"]' --interactive` + +- Start a REPL for ClojureScript and open a web browser: + +`clj -Sdeps '{:deps {org.clojure/clojurescript {:mvn/version "1.10.758"}}}' --main cljs.main --repl`