sitefox.util

Various utilities for server side ClojureScript.

btoa

(btoa s)

Server side version of browser JavaScript’s btoa base64 encoding.

env

(env k & [default])

Returns the environment variable named in k with optional default value.

env-required

(env-required k & [msg])

Returns the environment variable named in k or exits the process if missing. The message printed on exit can be customised in msg.

error-to-json

(error-to-json err)

Convert a JavaScript error into a form that can be returned as JSON data.