Skip to content

Instantly share code, notes, and snippets.

@joefromct
Created October 26, 2017 22:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joefromct/14e2590e1a093561cba43b3769f6d8a0 to your computer and use it in GitHub Desktop.
Save joefromct/14e2590e1a093561cba43b3769f6d8a0 to your computer and use it in GitHub Desktop.
(ns cljs-utils.core
(:require [clojure.string :as str]
[cljs.nodejs :as nodejs]))
(nodejs/enable-util-print!)
(defn -main [& args]
(let [
readline (nodejs/require "readline")
rl (.createInterface readline #js { "input" (.-stdin js/process)
"output" (.-stdout js/process)
"terminal" false})]
(.on rl "line", #(println (count %)))))
(set! *main-cli-fn* -main)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment