Skip to content

Instantly share code, notes, and snippets.

@joefromct
Last active October 26, 2017 22:38
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/b28bc124038c44a160adad463c98736e to your computer and use it in GitHub Desktop.
Save joefromct/b28bc124038c44a160adad463c98736e to your computer and use it in GitHub Desktop.
var readline = require('readline');
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: false
});
rl.on('line', function (line) {
console.log(line.length);
});
/*
(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