{code:title=src/foo/core.cljs}
(ns foo.core
(:require left-pad))
(defn pad [n]
(left-pad n 10 0))
We pass {{-d}} here to work around CLJS-2752 and CLJS-2666.
$ clj -m cljs.main -co '{:npm-deps {:left-pad "1.3.0"} :install-deps true}' -d out -r
cljs.user=> (load-file "foo/core.cljs")
nil
cljs.user=> (dir foo.core)
pad
nil
cljs.user=> (foo.core/pad 3)
ReferenceError: Can't find variable: foo
cljs.user=> (require 'foo.core)
cljs.user=> (foo.core/pad 3)
"0000000003"
Note that {{load-file}} fails (even though it can succeed; see CLJS-2753), while {{require}} succeeds.