Skip to content

Commit b63f56d

Browse files
committed
cljs scripting
1 parent be10d7d commit b63f56d

File tree

6 files changed

+196
-0
lines changed

6 files changed

+196
-0
lines changed

cljs-scripting/README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Scripting with ClojureScript
2+
3+
## Lumo
4+
5+
- https://github.com/anmonteiro/lumo
6+
- http://lumo-cljs.org
7+
- http://benzaporzan.me/blog/2018/3/26/lumo_brightening_the_horizons_for_clojurescripting/
8+
9+
## Planck
10+
11+
- http://planck-repl.org/scripts.html
12+

cljs-scripting/lumo/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/

cljs-scripting/lumo/hello.cljs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env lumo
2+
3+
(ns example.echo
4+
(:require ["shelljs" :as sh]))
5+
6+
(defonce path (js/require "path"))
7+
8+
; (doseq [arg *command-line-args*]
9+
; (println arg))
10+
11+
(defn- -main [& args]
12+
; (doseq [arg args] (println arg))
13+
(println (str (sh/cat (.join path (str (sh/pwd)) "package.json"))))
14+
)
15+
16+
(set! *main-cli-fn* -main)

cljs-scripting/lumo/package-lock.json

Lines changed: 137 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cljs-scripting/lumo/package.json

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"name": "lumo",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "index.js",
6+
"scripts": {
7+
"test": "echo \"Error: no test specified\" && exit 1"
8+
},
9+
"keywords": [],
10+
"author": "",
11+
"license": "ISC",
12+
"devDependencies": {
13+
"shelljs": "^0.8.3"
14+
}
15+
}

cljs-scripting/planck/hello.cljs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/usr/bin/env plk
2+
3+
; http://planck-repl.org/scripts.html
4+
5+
(ns example.echo
6+
(:require [planck.core :as core]))
7+
8+
(doseq [l (core/line-seq core/*in*)]
9+
(println l))
10+
11+
(doseq [arg *command-line-args*]
12+
(println arg))
13+
14+
(doseq [file (core/file-seq "/tmp")]
15+
(println (:path file)))

0 commit comments

Comments
 (0)