Punk is a REBL-like data browser built for the web.
Punk is built with a client-server architecture in order to support different kinds of environments you might want to send values from.
When in a web browser, it passes messages directly back and forth between your application and the UI. When in a server context (e.g. Node.js), it communicates via websockets.
For each platform, there is a Punk adapter
library which sets up the necessary
plumbing to allow your application to communicate to the UI application.
In a browser project, include the punk.adapter.web
library:
Leiningen/Boot
[lilactown/punk-adapter-web "0.0.2"]
Clojure CLI/deps.edn
lilactown/punk-adapter-web {:mvn/version "0.0.2"}
Then, in your CLJS build preloads, include the punk.adapter.web.preload
namespace:
;; shadow-cljs.edn example
:app {:target :browser
;; ...
:devtools {:preloads [punk.adapter.web.preload]}}
Now, load your app in the browser; Punk's drawer should be on the right hand
side. Clicking the drawer or pressing the hot key Ctrl-Alt-P
should expand the
UI.
In a Node.js project, include the punk.adapter.node
library:
Leiningen/Boot
[lilactown/punk-adapter-node "0.0.2"]
Clojure CLI/deps.edn
lilactown/punk-adapter-node {:mvn/version "0.0.2"}
Then, in your CLJS build preloads, include the punk.adapter.node.preload
namespace:
;; shadow-cljs.edn example
:app {:target :node-script
;; ...
:devtools {:preloads [punk.adapter.node.preload]}}
The Node.js adapter automatically starts a web server at http://localhost:9876. Navigate there to see the the Punk UI.
By default, Punk adds a listener to values emitted by tap>
. To inspect a value,
simply use the tap>
function to send it to the Punk application.
It's new, and still has bugs. Please file issues as you come across them!
If you have a feature request or any feedback on features, please create an issue with the "enhancement" tag.
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close