Skip to content

Instantly share code, notes, and snippets.

@arichiardi
Created March 5, 2018 21:12
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arichiardi/c48266457981dd9d47bc8c541fb4b32b to your computer and use it in GitHub Desktop.
Save arichiardi/c48266457981dd9d47bc8c541fb4b32b to your computer and use it in GitHub Desktop.
Dump the Clojure :npm-deps index
clojure -e "(require '[cljs.closure :as cc] '[clojure.pprint :refer [pprint]]) (pprint (cc/index-node-modules-dir $(cat cljsc_opts.edn)))" > npm-deps.edn
@arichiardi
Copy link
Author

arichiardi commented Mar 5, 2018

This is the command that will allow you to dump the data structure that ClojureScript uses when processing :npm-deps.

The map in cljsc_opts.edn is basically (not quite but a superset) the compiler option map, it can be empty.

Thanks @swannodette for sharing this bit on Slack.

@arichiardi
Copy link
Author

arichiardi commented Apr 23, 2018

the equivalent works in lumo as well:

lumo -sfK -e "(require '[lumo.closure :as cc] '[clojure.pprint :refer [pprint]]) (pprint (cc/index-node-modules-dir $(cat cljsc_opts.edn)))" > npm-deps.edn

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment