Skip to content

aterweele/nrepl-pprint-middleware

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nrepl-pprint-middleware is an nREPL middleware that uses clojure.pprint to pretty-print all REPL results. This improves readability for large and deeply-nested collections.

You may find nrepl-pprint-middleware useful if your nREPL tooling doesn’t pretty-print. I use it with monroe, for example. You may also find it useful if you start an nREPL in production and connect to it with lein repl :connect ....

https://img.shields.io/clojars/v/name.atw/nrepl-pprint-middleware.svg

Installation for local development

Add to your ~/.lein/profiles.clj:

{:user {:dependencies [[name.atw/nrepl-pprint-middleware version-goes-here]]
        :repl-options {:nrepl-middleware [nrepl-pprint-middleware.pprint/wrap-pprint]}}}

Installation for production

If you start an nREPL in your deployed application, you can also add nrepl-pprint-middleware to your production nREPL. Add it to your Leiningen dependencies:

[name.atw/nrepl-pprint-middleware version-goes-here]

Then somewhere in your application, start an nREPL with nrepl-pprint-middleware:

(ns ...
  (:require [nrepl.server :as nrepl]
            nrepl-pprint-middleware.pprint))

(defonce nrepl-server
  (nrepl/start-server
   :bind ... :port ...
   :handler (nrepl/default-handler nrepl-pprint-middleware.pprint/wrap-pprint)))

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published