Comments (4)
You can also do that with babashka for faster startup
from jet.
I'm playing around with this option, but I'm not sure if it would fit your needs this way. E.g., I'm using fipp (an EDN pretty printer):
$ cat deps.edn | clj -M -e "(require '[fipp.edn :as e]) (e/pprint (clojure.edn/read-string (slurp *in*)) {:width 20})"
{:paths ["src"
"resources"],
:deps {org.clojure/clojure {:mvn/version "1.11.1"},
mvxcvi/puget {:mvn/version "1.3.4"},
rewrite-clj/rewrite-clj {:mvn/version "1.1.47"},
commons-io/commons-io {:mvn/version "2.11.0"},
org.babashka/cli {:mvn/version "0.8.58"},
com.cognitect/transit-clj {:mvn/version "1.0.333"},
clj-commons/clj-yaml {:mvn/version "1.0.26"},
cheshire/cheshire {:mvn/version "5.11.0"},
org.babashka/sci {:mvn/version "0.8.41"},
com.rpl/specter {:mvn/version "1.1.4"},
camel-snake-kebab/camel-snake-kebab {:mvn/version "0.4.3"}},
:aliases {:test {:extra-paths ["test"],
:extra-deps {clj-commons/conch {:mvn/version "0.9.2"}}}},
:tools/usage {:ns-default jet.main}}
as you can see it still is more than 20 characters wide but the output does change when I set it to 200
from jet.
Bummer ... seems to work pretty well with clojure.pprint/pprint
(see below, docs here).
But I guess there's performance reasons that you're not using it? FWIW, I can always pipe through the snippet below, when I need to.
cat deps.edn | clj -M -e "(require '[clojure.pprint :as pprint]) (binding [pprint/*print-right-margin* 15] (pprint/pprint (clojure.edn/read-string (slurp *in*))))"
{:paths
["src"
"resources"],
:deps
{org.clojure/clojure
#:mvn{:version
"1.11.1"},
mvxcvi/puget
#:mvn{:version
"1.3.4"},
rewrite-clj/rewrite-clj
#:mvn{:version
"1.1.47"},
commons-io/commons-io
[snip]
from jet.
I'm not exactly sure why I used fipp instead of pprint, I think it was because pprint didn't work properly with graalvm a long time ago.
from jet.
Related Issues (20)
- Feature request: "raw" output flag HOT 4
- Feature request: support M1 architecture HOT 6
- nippy support HOT 2
- messagepack support
- `install` script does not work
- Error on example output on the README file HOT 2
- Base64 support HOT 5
- Add jq namespace with paths function
- `install` script does not work HOT 2
- Binary support for Linux-aarch64 HOT 5
- Remove , (comm) from edn HOT 12
- Possible cljs library usage? HOT 1
- --keywordize fn not called when input is yaml HOT 1
- Error installing v0.6.26 on MacOS with Homebrew HOT 2
- update-vals etc from Clojure 1.11 missing HOT 10
- Move to tools.build so we can use git deps
- Add named cases for convenience to the --keywordize / -k switch HOT 7
- use jet from nix HOT 5
- Default --edn-reader-opts not being set correclty
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jet.