Skip to content

Commit 87261e3

Browse files
author
Dustin Smith
committed
Updating docs for v1.1.0
1 parent 6aec5c2 commit 87261e3

File tree

4 files changed

+32
-2
lines changed

4 files changed

+32
-2
lines changed

History.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v1.1.0
2+
3+
* Fix for when chunk returned by transform to the parser ends with a space
4+
* Functionality to give a reason when invalid data
5+
* Fix problem with utf8 encoded streams that have multi-byte characters
6+
* Allow passing sparse array of headers
7+
18
# v1.0.0
29

310
* Node 4 and 5 support.

docs/History.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@
176176

177177

178178

179+
<h1 id="v1-1-0">v1.1.0</h1>
180+
<ul>
181+
<li>Fix for when chunk returned by transform to the parser ends with a space</li>
182+
<li>Functionality to give a reason when invalid data</li>
183+
<li>Fix problem with utf8 encoded streams that have multi-byte characters</li>
184+
<li>Allow passing sparse array of headers</li>
185+
</ul>
186+
<h1 id="v1-0-0">v1.0.0</h1>
187+
<ul>
188+
<li>Node 4 and 5 support.</li>
189+
<li>Deprecating the <code>record</code> event.</li>
190+
</ul>
179191
<h1 id="v0-6-0">v0.6.0</h1>
180192
<ul>
181193
<li>Removed try catch from emit to allow bubbling up of errors to process, if one is thrown <a href="https://github.com/C2FO/fast-csv/issues/93">#93</a><ul>

docs/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ <h3 id="parsing">Parsing</h3>
188188
<p>All methods accept the following <code>options</code></p>
189189
<ul>
190190
<li><code>objectMode=true</code>: Ensure that <code>data</code> events have an object emitted rather than the stringified version set to false to have a stringified buffer.</li>
191-
<li><code>headers=false</code>: Set to true if you expect the first line of your <code>CSV</code> to contain headers, alternatly you can specify an array of headers to use.</li>
191+
<li><code>headers=false</code>: Set to true if you expect the first line of your <code>CSV</code> to contain headers, alternatly you can specify an array of headers to use. You can also specify a sparse array to omit some of the columns.</li>
192192
<li><code>ignoreEmpty=false</code>: If you wish to ignore empty rows.</li>
193193
<li><code>discardUnmappedColumns=false</code>: If you want to discard columns that do not map to a header.</li>
194194
<li><code>strictColumnHandling=false</code>: If you want to consider empty lines/lines with too few fields as errors - Only to be used with <code>headers=true</code></li>
@@ -337,6 +337,17 @@ <h3 id="parsing">Parsing</h3>
337337
.on(&quot;end&quot;, function(){
338338
console.log(&quot;done&quot;);
339339
});</code></pre>
340+
<p>To omit some of the data columns you may not need, pass a sparse array as <code>headers</code>.</p>
341+
<pre class='prettyprint linenums lang-js'><code class="lang-javascript">var stream = fs.createReadStream(&quot;my.csv&quot;);
342+
343+
csv
344+
.fromStream(stream, {headers : [&quot;firstName&quot; , , &quot;address&quot;]})
345+
.on(&quot;data&quot;, function(data){
346+
console.log(data);
347+
})
348+
.on(&quot;end&quot;, function(){
349+
console.log(&quot;done&quot;);
350+
});</code></pre>
340351
<p>If your data may include empty rows, the sort Excel might include at the end of the file for instance, you can ignore
341352
these by including the <code>ignoreEmpty</code> option.</p>
342353
<p>Any rows consisting of nothing but empty strings and/or commas will be skipped, without emitting a &#39;data&#39; or &#39;error&#39; event.</p>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "fast-csv",
3-
"version": "1.0.0",
3+
"version": "1.1.0",
44
"description": "CSV parser and writer",
55
"main": "index.js",
66
"scripts": {

0 commit comments

Comments
 (0)