Liking cljdoc? Tell your friends :D

cljs-node-io.spawn


ChildProcesscljs


cp->chcljs

(cp->ch proc)
(cp->ch proc {:keys [key buf-or-n] :or {buf-or-n 10}})

Wraps all ChildProcess events into messages put! on a core.async channel. The chan will close when all underlying data sources close. See doc for cljs-node-io.proc/child for opts. If key is provided, msgs below are prefixed as [key msg] [:error [js/Error]] [:disconnect] [:message [#js{} ?handle]] [:exit [?code ?signal]] [:close [?code ?signal]] [:stdout [:data [chunk]]] [:stdout [:error [js/Error]]] [:stdout [:end nil]] [:stderr [:data [chunk]]] [:stderr [:error [js/Error]]] [:stderr [:end nil]] [:stdin [:error [js/Error]]] [:stdin [:end nil]] @return {!cljs.core.async.impl.protocols/Channel}

Wraps all ChildProcess events into messages put! on a core.async channel.
The chan will close when all underlying data sources close.
See doc for cljs-node-io.proc/child for opts.
If key is provided, msgs below are prefixed as [key msg]
  [:error [js/Error]]
  [:disconnect]
  [:message [#js{} ?handle]]
  [:exit [?code ?signal]]
  [:close [?code ?signal]]
  [:stdout [:data [chunk]]]
  [:stdout [:error [js/Error]]]
  [:stdout [:end nil]]
  [:stderr [:data [chunk]]]
  [:stderr [:error [js/Error]]]
  [:stderr [:end nil]]
  [:stdin [:error [js/Error]]]
  [:stdin [:end nil]]
@return {!cljs.core.async.impl.protocols/Channel}
raw docstring

forkcljs

(fork modulePath args {:keys [encoding] :as opts})

Launch a node child process with an IPC Socket.

  • send values via .send()

@param {!string} modulePath :: path to js file to run @param {!IVector} args :: arguments to the js file @param {!IMap} opts :: execution options + cp-out-options

  • execution opts:
    • :silent -> true
    • :stdio -> 'pipe' disallow change
  • cp-out options: :buf-or-n -> passed to all subchannels, defaults to 10 :key -> is used to prefix all emitted values. Use to identify and route data. ex no key: [:stdout [:data ['some data']]] ex w/ key: ['my-child-proc' [:stdout [:data ['some data']]]] @return {!proc/PortedChildProcess} ChildProcess with a ReadPort
Launch a node child process with an IPC Socket.
 + send values via .send()

@param {!string} modulePath :: path to js file to run
@param {!IVector} args :: arguments to the js file
@param {!IMap} opts :: execution options + cp-out-options
 + execution opts:
   - :silent -> true
   - :stdio -> 'pipe'  disallow change
 + cp-out options:
   :buf-or-n -> passed to all subchannels, defaults to 10
   :key  -> is used to prefix all emitted values. Use to identify and route data.
     ex no key: [:stdout [:data ['some data']]]
     ex w/ key: ['my-child-proc' [:stdout [:data ['some data']]]]
@return {!proc/PortedChildProcess} ChildProcess with a ReadPort
raw docstring

spawncljs

(spawn cmd args {:keys [encoding] :as opts})

@param {!string} cmd :: command to execute in a shell @param {!IVector} args :: args to the shell command @param {!IMap} opts :: execution options + cp-out-options

  • execution opts:

  • cp-out options: :buf-or-n -> passed to all subchannels, defaults to 10 :key -> is used to prefix all emitted values. Use to identify and route data. ex no key: [:stdout [:data ['some data']]] ex w/ key: ['my-child-proc' [:stdout [:data ['some data']]]] @return {!proc/PortedChildProcess} ChildProcess with a ReadPort
@param {!string} cmd :: command to execute in a shell
@param {!IVector} args :: args to the shell command
@param {!IMap} opts :: execution options + cp-out-options
 + execution opts:
   -
 + cp-out options:
   :buf-or-n -> passed to all subchannels, defaults to 10
   :key  -> is used to prefix all emitted values. Use to identify and route data.
     ex no key: [:stdout [:data ['some data']]]
     ex w/ key: ['my-child-proc' [:stdout [:data ['some data']]]]
@return {!proc/PortedChildProcess} ChildProcess with a ReadPort
raw docstring

start-timecljs

(start-time)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close