Host access abstractions for ClojureScript
Switch branches/tags
Nothing to show
Clone or download
Latest commit c51ffe4 Sep 26, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/abio Clean up more comments May 23, 2018
.gitignore updated .gitignore May 11, 2018
LICENSE Add LICENSE Jan 5, 2017 Clean up docstrings, comments, and Readme May 18, 2018
deps.edn Add deps.edn Sep 26, 2018
project.clj Add group to artifact Jan 5, 2017


A set of host abstractions mimicking similar facilities available in Clojure for I/O, shell access, etc., along with mechanisms to bind the abstractions to host-specific implementations.

Architectural Design

  1. Use a dynamic variable that is referenced throughout the library. This holds the host implementations and makes using them straightforward
  2. Define Protocols for Reading/Writing/Streaming
  3. Define a Bindings protocol for creating and interacting with the host implementation to construct the records that implement the R/W/S protocols from #2
  4. Define helper functions to tie into the host implementation


See the examples directory in the Node bindings implementation.

$ lumo -qc abio.jar:abio-node.jar
cljs.user=> (require 'abio.core '[ :as io] 'abio.node)
cljs.user=> (abio.core/set-bindings! (abio.node/bindings))
cljs.user=> (def users-dir (io/as-file "/Users"))
cljs.user=> users-dir{:path "/Users"}
cljs.user=> (io/directory? users-dir)
cljs.user=> (io/directory? "/etc/hosts")
cljs.user=> (def r (io/reader "/usr/share/dict/words" :encoding "UTF8"))
cljs.user=> (take 8 (io/line-seq r))
("A" "a" "aa" "aal" "aalii" "aam" "Aani" "aardvark")


Copyright © 2017 abiocljs and Contributors

Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.