A ClojureScript library for reading and writing comma separated values.
[testdouble/clojurescript.csv "0.1.0"]
<dependency>
<groupId>testdouble</groupId>
<artifactId>clojurescript.csv</artifactId>
<version>0.1.0</version>
</dependency>
(ns my.domain.core
(:require [testdouble.cljs.csv :as csv]))
;; Basic usage
(csv/write-csv [[1 2 3] [4 5 6]])
;;=> "1,2,3\n4,5,6"
;; Define your own separator
(csv/write-csv [[1 2 3] [4 5 6]] :separator "|")
;;=> "1|2|3\n4|5|6"
;; Use either :lf (default) or :cr+lf as the newline character
(csv/write-csv [[1 2 3] [4 5 6]] :newline :cr+lf)
;;=> "1,2,3\r\n4,5,6"
Running the tests:
$ lein cljsbuild test
(assumes Leiningen 2.x)
Thanks to all of our contributors.
We welcome all contributors to the project. Please submit an Issue and a Pull Request if you have one.
More documentation can be found on the wiki.
Copyright © 2014 Test Double
Distributed under the Eclipse Public License either version 1.0 or (at your option) any later version.