Skip to content

Commit

Permalink
site docs
Browse files Browse the repository at this point in the history
  • Loading branch information
j50n committed Jan 15, 2024
1 parent bd9dc02 commit 9d5aead
Show file tree
Hide file tree
Showing 14 changed files with 62 additions and 56 deletions.
2 changes: 1 addition & 1 deletion dev/read.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { enumerate } from "https://deno.land/x/proc@0.21.8/mod.ts";
import { enumerate } from "https://deno.land/x/proc@0.21.9/mod.ts";

for await (const line of enumerate(Deno.stdin.readable).lines) {
console.log(line);
Expand Down
6 changes: 3 additions & 3 deletions docs/example-concurrent-processing.html
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ <h1 id="concurrent-processes"><a class="header" href="#concurrent-processes">Con
most storage. <code>proc</code> makes it possible to run <code>ls --summarize</code> with parallelism
matching the number of CPU cores available (or whatever concurrency you
specify). The specific methods that support concurrent operations are
<a href="https://deno.land/x/proc@0.21.8/mod3.ts?s=Enumerable&amp;p=prototype.concurrentMap">.concurrentMap()</a>
<a href="https://deno.land/x/proc@0.21.9/mod3.ts?s=Enumerable&amp;p=prototype.concurrentMap">.concurrentMap()</a>
and
<a href="https://deno.land/x/proc@0.21.8/mod3.ts?s=Enumerable&amp;p=prototype.concurrentUnorderedMap">.concurrentUnorderedMap()</a>.</p>
<a href="https://deno.land/x/proc@0.21.9/mod3.ts?s=Enumerable&amp;p=prototype.concurrentUnorderedMap">.concurrentUnorderedMap()</a>.</p>
<p>To list the <code>s3</code> buckets in your AWS account from terminal:</p>
<pre><code class="language-sh">aws s3 ls
</code></pre>
Expand Down Expand Up @@ -223,7 +223,7 @@ <h1 id="concurrent-processes"><a class="header" href="#concurrent-processes">Con
)
</code></pre>
<p>Use <code>nice</code> because <em>this will eat your server otherwise.</em> The method
<a href="https://deno.land/x/proc@0.21.8/mod3.ts?s=Enumerable&amp;p=prototype.concurrentUnorderedMap">.concurrentUnorderedMap()</a>
<a href="https://deno.land/x/proc@0.21.9/mod3.ts?s=Enumerable&amp;p=prototype.concurrentUnorderedMap">.concurrentUnorderedMap()</a>
will, by default, run one process for each CPU available concurrently until all
work is done.</p>
<p>The result will look something like this:</p>
Expand Down
8 changes: 4 additions & 4 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ <h1 class="menu-title">proc</h1>

<div id="content" class="content">
<main>
<h1 id="proc-0218"><a class="header" href="#proc-0218"><code>proc 0.21.8</code></a></h1>
<h1 id="proc-0219"><a class="header" href="#proc-0219"><code>proc 0.21.9</code></a></h1>
<p><code>proc</code> let's you use child processes with
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator"><code>AsyncIterable</code></a>
instead of the streams API, and it includes a library of higher-order functions
for <code>AsyncIterator</code> via
<a href="https://deno.land/x/proc@0.21.8/mod.ts?s=Enumerable"><code>Enumerable</code></a> that
<a href="https://deno.land/x/proc@0.21.9/mod.ts?s=Enumerable"><code>Enumerable</code></a> that
roughly matches what you can do with an array (<code>map</code>, <code>filter</code>, <code>find</code>), but for
asynchronous code.</p>
<p><code>proc</code> simplifies the process of converting a <code>bash</code> script into a Deno
application. The intention is to make writing code that uses lots of IO and
child processes <em>almost</em> as easy as shell scripting, but you also get proper
error handling, type checking, and Deno's security-by-default.</p>
<p><a href="https://deno.land/x/proc@0.21.8/mod.ts">Developer Documentation</a></p>
<p><a href="https://deno.land/x/proc@0.21.9/mod.ts">Developer Documentation</a></p>
<h2 id="usage"><a class="header" href="#usage">Usage</a></h2>
<pre><code class="language-typescript">import { run } from &quot;https://deno.land/x/proc@0.21.8/mod.ts&quot;;
<pre><code class="language-typescript">import { run } from &quot;https://deno.land/x/proc@0.21.9/mod.ts&quot;;
</code></pre>
<h2 id="a-simple-example"><a class="header" href="#a-simple-example">A Simple Example</a></h2>
<p>Run <code>ls -la</code> as a child process. Decode <code>stdout</code> as lines of text. Print to
Expand Down
8 changes: 4 additions & 4 deletions docs/introduction.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,21 +173,21 @@ <h1 class="menu-title">proc</h1>

<div id="content" class="content">
<main>
<h1 id="proc-0218"><a class="header" href="#proc-0218"><code>proc 0.21.8</code></a></h1>
<h1 id="proc-0219"><a class="header" href="#proc-0219"><code>proc 0.21.9</code></a></h1>
<p><code>proc</code> let's you use child processes with
<a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AsyncIterator"><code>AsyncIterable</code></a>
instead of the streams API, and it includes a library of higher-order functions
for <code>AsyncIterator</code> via
<a href="https://deno.land/x/proc@0.21.8/mod.ts?s=Enumerable"><code>Enumerable</code></a> that
<a href="https://deno.land/x/proc@0.21.9/mod.ts?s=Enumerable"><code>Enumerable</code></a> that
roughly matches what you can do with an array (<code>map</code>, <code>filter</code>, <code>find</code>), but for
asynchronous code.</p>
<p><code>proc</code> simplifies the process of converting a <code>bash</code> script into a Deno
application. The intention is to make writing code that uses lots of IO and
child processes <em>almost</em> as easy as shell scripting, but you also get proper
error handling, type checking, and Deno's security-by-default.</p>
<p><a href="https://deno.land/x/proc@0.21.8/mod.ts">Developer Documentation</a></p>
<p><a href="https://deno.land/x/proc@0.21.9/mod.ts">Developer Documentation</a></p>
<h2 id="usage"><a class="header" href="#usage">Usage</a></h2>
<pre><code class="language-typescript">import { run } from &quot;https://deno.land/x/proc@0.21.8/mod.ts&quot;;
<pre><code class="language-typescript">import { run } from &quot;https://deno.land/x/proc@0.21.9/mod.ts&quot;;
</code></pre>
<h2 id="a-simple-example"><a class="header" href="#a-simple-example">A Simple Example</a></h2>
<p>Run <code>ls -la</code> as a child process. Decode <code>stdout</code> as lines of text. Print to
Expand Down
11 changes: 7 additions & 4 deletions docs/io/read.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,12 +174,14 @@ <h1 class="menu-title">proc</h1>
<div id="content" class="content">
<main>
<h1 id="reading-data"><a class="header" href="#reading-data">Reading Data</a></h1>
<p><a href=""><code>enumerate</code></a> works with any iterable, including a <code>ReadableStream</code> (which is an <code>AsyncIterable</code>).</p>
<p><a href=""><code>enumerate</code></a> works with any iterable, including a <code>ReadableStream</code> (which is
an <code>AsyncIterable</code>).</p>
<h2 id="reading-from-stdin"><a class="header" href="#reading-from-stdin">Reading from <code>stdin</code></a></h2>
<p>Deno provides <code>Deno.stdin.readable</code> which gives you a <code>stdin</code> as a <code>ReadableStream&lt;Uint8Array&gt;</code>. We can
wrap this with <code>enumerate(...)</code> to convert to lines of text (strings).</p>
<p>Deno provides <code>Deno.stdin.readable</code> which gives you a <code>stdin</code> as a
<code>ReadableStream&lt;Uint8Array&gt;</code>. We can wrap this with <code>enumerate(...)</code> to convert
to lines of text (strings).</p>
<p>Text of <code>example.ts</code>:</p>
<pre><code class="language-typescript">import { enumerate } from &quot;https://deno.land/x/proc@0.21.8/mod.ts&quot;;
<pre><code class="language-typescript">import { enumerate } from &quot;https://deno.land/x/proc@0.21.9/mod.ts&quot;;

for await (const line of enumerate(Deno.stdin.readable).lines) {
console.log(line);
Expand All @@ -189,6 +191,7 @@ <h2 id="reading-from-stdin"><a class="header" href="#reading-from-stdin">Reading
<pre><code class="language-shell">zcat warandpeace.txt.gz | deno run example.ts
</code></pre>
<p>This operation will consume <code>stdin</code> and close it.</p>
<h2 id="reading-from-file"><a class="header" href="#reading-from-file">Reading from File</a></h2>

</main>

Expand Down
2 changes: 1 addition & 1 deletion docs/misc/sleep.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ <h1 class="menu-title">proc</h1>

<div id="content" class="content">
<main>
<h1 id="sleep"><a class="header" href="#sleep"><a href="https://deno.land/x/proc@0.21.8/mod.ts?s=sleep">sleep</a></a></h1>
<h1 id="sleep"><a class="header" href="#sleep"><a href="https://deno.land/x/proc@0.21.9/mod.ts?s=sleep">sleep</a></a></h1>
<p><code>sleep</code> returns a <code>Promise</code> that resolves after a specified number of
milliseconds.</p>
<pre><code class="language-typescript">console.log(&quot;Program starts&quot;);
Expand Down
Loading

0 comments on commit 9d5aead

Please sign in to comment.