Mailspring/docs/BufferedProcess.html

100 lines
2.9 KiB
HTML
Raw Normal View History

2015-10-03 01:57:40 +08:00
---
layout: docs
title: BufferedProcess
2015-10-04 04:39:16 +08:00
edit_url: "https://github.com/nylas/N1/blob/master/src/buffered-process.coffee"
2015-10-03 01:57:40 +08:00
---
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
<h2>Summary</h2>
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
<div class="markdown-from-sourecode">
<p><p>A wrapper which provides standard error/output line buffering for
2015-10-02 03:34:16 +08:00
Node&#39;s ChildProcess.</p>
</p>
2015-10-03 01:57:40 +08:00
</div>
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
<ul>
<li><a href="#Construction">Construction</a></li>
<li><a href="#Event Subscription">Event Subscription</a></li>
<li><a href="#Helper Methods">Helper Methods</a></li>
</ul>
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
<h3>Instance Methods</h3>
2015-10-02 03:34:16 +08:00
2015-10-03 01:57:40 +08:00
<h4 id=constructor class="function-name">
constructor(<span class="args"><span class="arg">options</span></span>) <a href="#constructor" class="link"></a>
</h4>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<div class="function-description markdown-from-sourecode">
<p><p>Runs the given command by spawning a new child process.</p>
</p>
</div>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<strong>Parameters</strong>
<table class="arguments">
2015-10-02 03:34:16 +08:00
<tr>
2015-10-03 01:57:40 +08:00
<th>Argument</th>
<th>Description</th>
2015-10-02 03:34:16 +08:00
</tr>
2015-10-03 01:57:40 +08:00
<tr>
<td style="width:15%;">
<em>options</em>
</td>
<td class="markdown-from-sourecode">
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<p>An <a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/object'>Object</a> with the following keys:</p>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
</td>
</tr>
</table>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<h4 id=onWillThrowError class="function-name">
onWillThrowError(<span class="args"><span class="arg">callback</span></span>) <a href="#onWillThrowError" class="link"></a>
</h4>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<div class="function-description markdown-from-sourecode">
<p><p>Will call your callback when an error will be raised by the process.
Usually this is due to the command not being available or not on the PATH.
You can call <code>handle()</code> on the object passed to your callback to indicate
that you have handled this error.</p>
</p>
</div>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<strong>Parameters</strong>
<table class="arguments">
<tr>
<th>Argument</th>
<th>Description</th>
</tr>
<tr>
<td style="width:15%;">
<em>callback</em>
</td>
<td class="markdown-from-sourecode">
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<p><a href='https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/function'>Function</a> callback</p>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
</td>
</tr>
</table>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<strong>Returns</strong>
<table class="arguments">
<tr>
<th>Return Values</th>
</tr>
<tr><td class="markdown-from-sourecode"><p>Returns a {Disposable}</p>
</td></tr>
</table>
<h4 id=kill class="function-name">
kill(<span class="args"></span>) <a href="#kill" class="link"></a>
</h4>
2015-10-04 04:39:16 +08:00
2015-10-03 01:57:40 +08:00
<div class="function-description markdown-from-sourecode">
<p><p>Terminate the process. </p>
</p>
</div>