(def child-process (nd/require "child_process"))
(defn exec [cmd opt fn] (.exec child-process cmd opt fn))
(let [opt (clojuremap->jsobj {:cwd "path"})]
(exec "ls -la" opt (fn [err stdout stderr] ....)))
But can't figure out how to swap exec for spawn. Has any one done this?
http://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options
Another big difference is that exec gives you the results in the callback and spawn returns a ChildProcess object which is an event emitter, so it is not a matter of just swapping which function you are using.
Look at the examples in the docs and translate them to cljs, it should be easy and there are plenty of them.
Cheers
--
Note that posts from new members are moderated - please be patient with your first post.
---
You received this message because you are subscribed to a topic in the Google Groups "ClojureScript" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/clojurescript/TObqicBxmKQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to clojurescrip...@googlegroups.com.
To post to this group, send email to clojur...@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.
Glad I could help :)