Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added mobi and epub to `make all`

  • Loading branch information...
commit 2f6a03cbb6eba41c7fc5e3278c56aa1f4797d0df 1 parent 63aba63
@tj tj authored
View
2  Makefile
@@ -23,7 +23,7 @@ MD = pages/index.md \
HTML = $(MD:.md=.html)
-all: book.html book.pdf
+all: book.html book.pdf book.mobi book.epub
book.pdf: $(HTML)
htmldoc $(HTML) $(PDF_FLAGS) --outfile $@
View
10 book.html
@@ -523,7 +523,7 @@ <h3 id="errno">errno</h3>
</div>
<div class='mp'>
<h1>Events</h1>
-<p> Events are crucial to node, and used greatly throughout core and 3rd-party modules. Node's core library <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
+<p> The concept of an "event" is crucial to node, and used greatly throughout core and 3rd-party modules. Node's core module <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
<h2 id="Emitting-Events">Emitting Events</h2>
@@ -598,7 +598,7 @@ <h2 id="Removing-Event-Listeners">Removing Event Listeners</h2>
</div>
<div class='mp'>
<h1>Buffers</h1>
-<p> To handle binary data, node provides us the <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to constructor a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
+<p> To handle binary data, node provides us with the global <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to construct a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
<p>The simplest way to construct a <code>Buffer</code> from a string is to simply pass a string as the first argument. As you can see by the log output, we now have a buffer object containing 5 bytes of data represented in hexadecimal.</p>
@@ -637,7 +637,7 @@ <h2 id="Removing-Event-Listeners">Removing Event Listeners</h2>
// =&gt; "Hello"
</code></pre>
-<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, compared to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
+<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, opposed to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
<pre><code>var ellipsis = new Buffer('…', 'utf8');
@@ -651,9 +651,9 @@ <h2 id="Removing-Event-Listeners">Removing Event Listeners</h2>
// =&gt; &lt;Buffer e2 80 a6>
</code></pre>
-<p>When working with JavaScript strings, we can also pass a string through the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
+<p>When dealing with JavaScript strings, we may pass it to the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
-<p>The api is written in such a way that it is Array-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
+<p>The api is written in such a way that it is String-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
<pre><code>var chunk = buf.slice(4, 9);
console.log(chunk.toString());
View
BIN  book.mobi
Binary file not shown
View
BIN  book.pdf
Binary file not shown
View
8 chapters/buffers.html
@@ -1,6 +1,6 @@
<div class='mp'>
<h1>Buffers</h1>
-<p> To handle binary data, node provides us the <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to constructor a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
+<p> To handle binary data, node provides us with the global <code>Buffer</code> object. Buffer instances represent memory allocated independently to that of V8's heap. There are several ways to construct a <code>Buffer</code> instance, and many ways you can manipulate it's data.</p>
<p>The simplest way to construct a <code>Buffer</code> from a string is to simply pass a string as the first argument. As you can see by the log output, we now have a buffer object containing 5 bytes of data represented in hexadecimal.</p>
@@ -39,7 +39,7 @@
// =&gt; "Hello"
</code></pre>
-<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, compared to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
+<p>The <code>.length</code> property of a buffer instance contains the byte length of the stream, opposed to JavaScript strings which will simply return the number of characters. For example the ellipsis character '…' consists of three bytes, however the buffer will respond with the byte length, and not the character length.</p>
<pre><code>var ellipsis = new Buffer('…', 'utf8');
@@ -53,9 +53,9 @@
// =&gt; &lt;Buffer e2 80 a6>
</code></pre>
-<p>When working with JavaScript strings, we can also pass a string through the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
+<p>When dealing with JavaScript strings, we may pass it to the <code>Buffer.byteLength()</code> method to determine it's byte length.</p>
-<p>The api is written in such a way that it is Array-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
+<p>The api is written in such a way that it is String-like, so for example we can work with "slices" of a <code>Buffer</code> by passing offsets to the <code>slice()</code> method:</p>
<pre><code>var chunk = buf.slice(4, 9);
console.log(chunk.toString());
View
2  chapters/events.html
@@ -1,6 +1,6 @@
<div class='mp'>
<h1>Events</h1>
-<p> Events are crucial to node, and used greatly throughout core and 3rd-party modules. Node's core library <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
+<p> The concept of an "event" is crucial to node, and used greatly throughout core and 3rd-party modules. Node's core module <em>events</em> supplies us with a single constructor, <em>EventEmitter</em>.</p>
<h2 id="Emitting-Events">Emitting Events</h2>
Please sign in to comment.
Something went wrong with that request. Please try again.