Created
October 3, 2021 08:25
-
-
Save chr15m/38fa71a155caade3e24fdb5c76fbaab4 to your computer and use it in GitHub Desktop.
Generate :npm-deps in deps.cljs from package.json using nbb
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns update-deps | |
(:require | |
["fs" :as fs] | |
[clojure.edn :as edn] | |
[clojure.pprint :refer [pprint]])) | |
(let [package (js/require "../package.json") | |
js-deps (js->clj (aget package "dependencies")) | |
deps (edn/read-string (fs/readFileSync "src/deps.cljs" "utf8")) | |
deps-updated (assoc deps :npm-deps js-deps)] | |
(binding [*print-fn* (fn [s] | |
(fs/writeFileSync "src/deps.cljs" s))] | |
(pprint deps-updated))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment