If running on ClojureScript, we can have a different file for JS.
BTW, in this NS, we avoid using Spec / Orchestra.
DO NOT define macros in this namespace - see cli-matic.platform-macros
## Platform-specific functions for the JVM. If running on ClojureScript, we can have a different file for JS. BTW, in this NS, we avoid using Spec / Orchestra. **DO NOT** define macros in this namespace - see [[cli-matic.platform-macros]]
At the moment, we only support Planck.
BTW, in this NS, we avoid using Spec / Orchestra.
## Platform-specific functions for ClojureScript. At the moment, we only support Planck. BTW, in this NS, we avoid using Spec / Orchestra.
(add-shutdown-hook fnToCallOnShutdown)
Add a shutdown hook. If nil
, simply ignores it.
The shutdown hook is run in a new thread.
Add a shutdown hook. If `nil`, simply ignores it. The shutdown hook is run in a new thread.
Add a shutdown hook.
Does not work (?) on CLJS and we will throw an exception.
It might be conceivable that in JS-land, we save this locally in this namespace
and then call it on exit-script
.
Add a shutdown hook. Does not work (?) on CLJS and we will throw an exception. It might be conceivable that in JS-land, we save this locally in this namespace and then call it on `exit-script`.
(asDate s)
Converts a string in format yyyy-mm-dd to a Date object; if conversion fails, returns nil.
Converts a string in format yyyy-mm-dd to a Date object; if conversion fails, returns nil.
(exit-script retval)
Terminates execution with a return value.
Terminates execution with a return value.
Terminates execution with a return value.
Please note that in Planck, return codes seem to be 8-bit unsigned ints.
Terminates execution with a return value. Please note that in Planck, return codes seem to be 8-bit unsigned ints.
(parseEdn edn-in)
Decodes EDN through clojure.edn.
Decodes EDN through clojure.edn.
This is actually a piece of ClojureScript, though it lives in a different NS.
This is actually a piece of ClojureScript, though it lives in a different NS. See https://cljs.github.io/api/cljs.reader/read-string
(parseFloat s)
Converts a string to a float.
Converts a string to a float.
(parseInt s)
Converts a string to an integer.
Converts a string to an integer.
(read-env var)
Reads an environment variable. If undefined, returns nil.
Reads an environment variable. If undefined, returns nil.
(slurp-file f)
No slurping in JavaScript. So we have to move this to platform.
No slurping in JavaScript. So we have to move this to platform.
Luckily, Planck implements slurp for us.
No slurping in Node-land.
Luckily, Planck implements slurp for us. No slurping in Node-land. See https://github.com/pkpkpk/cljs-node-io
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close