Skip to content

Commit 1707f04

Browse files
committed
Merge pull request #88 from doug-martin/master
v 0.5.6
2 parents 8ba6b2a + 2f96cd8 commit 1707f04

File tree

9 files changed

+229
-68
lines changed

9 files changed

+229
-68
lines changed

.travis.yml

+1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,6 @@ language: node_js
22
node_js:
33
- "0.10"
44
- "0.11"
5+
- "0.12"
56
before_script:
67
- npm install -g grunt-cli

History.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# v0.5.6
2+
3+
* Fixed issue where parser_stream was emitting end early [#87](https://github.com/C2FO/fast-csv/issues/87)
4+
* Changed to not emit end during flush
5+
* Changed catch errors on emit and emit as "error" event
6+
* Added support for node `v0.12`
7+
18
# v0.5.5
29
* Fixed issues with ordering of headers when specifying headers in a write stream [#77](https://github.com/C2FO/fast-csv/pull/77)
310
* Fixed issue where headers were not being written if no data was supplied to write stream.

docs/History.html

+31-22
Original file line numberDiff line numberDiff line change
@@ -176,33 +176,42 @@
176176

177177

178178

179-
<h1 id="v0-5-5">v0.5.5</h1>
179+
<h1>v0.5.6</h1>
180+
<ul>
181+
<li>Fixed issue where parser_stream was emitting end early <a href="https://github.com/C2FO/fast-csv/issues/87">#87</a><ul>
182+
<li>Changed to not emit end during flush</li>
183+
<li>Changed catch errors on emit and emit as &quot;error&quot; event</li>
184+
</ul>
185+
</li>
186+
<li>Added support for node <code>v0.12</code></li>
187+
</ul>
188+
<h1>v0.5.5</h1>
180189
<ul>
181190
<li>Fixed issues with ordering of headers when specifying headers in a write stream <a href="https://github.com/C2FO/fast-csv/pull/77">#77</a></li>
182191
<li>Fixed issue where headers were not being written if no data was supplied to write stream.</li>
183192
</ul>
184-
<h1 id="v0-5-4">v0.5.4</h1>
193+
<h1>v0.5.4</h1>
185194
<ul>
186195
<li>Fixed issues with error handling and not registering an error handler on stream <a href="https://github.com/C2FO/fast-csv/issues/68">#68</a></li>
187196
<li>Added support for ignoring quoting while parsing <a href="https://github.com/C2FO/fast-csv/issues/75">#75</a></li>
188197
</ul>
189-
<h1 id="v0-5-3">v0.5.3</h1>
198+
<h1>v0.5.3</h1>
190199
<ul>
191200
<li>Fixed issues with <code>v0.11</code> stream implementation <a href="https://github.com/C2FO/fast-csv/issues/73">#73</a></li>
192201
<li>Fixed issues with <code>pause/resume</code> and data events in <code>v0.10</code> <a href="https://github.com/C2FO/fast-csv/issues/69">#69</a></li>
193202
<li>Fixed the double invoking of done callback when parsing files <a href="https://github.com/C2FO/fast-csv/issues/68">#68</a></li>
194203
<li>Refactored tests</li>
195204
</ul>
196-
<h1 id="v0-5-2">v0.5.2</h1>
205+
<h1>v0.5.2</h1>
197206
<ul>
198207
<li>Fixed issue with <code>writeToString</code> and <code>writeToPath</code> examples <a href="https://github.com/C2FO/fast-csv/issues/64">#64</a></li>
199208
<li>Fixed issue with creating a csv without headers <a href="https://github.com/C2FO/fast-csv/issues/63">#63</a></li>
200209
</ul>
201-
<h1 id="v0-5-1">v0.5.1</h1>
210+
<h1>v0.5.1</h1>
202211
<ul>
203212
<li>Fixed issue where line data was not being passed between transforms in the parser_stream</li>
204213
</ul>
205-
<h1 id="v0-5-0">v0.5.0</h1>
214+
<h1>v0.5.0</h1>
206215
<ul>
207216
<li>Added support for async transforms <a href="https://github.com/C2FO/fast-csv/issues/24">#24</a></li>
208217
<li>Added support for async validation</li>
@@ -219,67 +228,67 @@ <h1 id="v0-5-0">v0.5.0</h1>
219228
<li>More tests</li>
220229
<li>Code refactor and clean up</li>
221230
</ul>
222-
<h1 id="v0-4-4">v0.4.4</h1>
231+
<h1>v0.4.4</h1>
223232
<ul>
224233
<li>Added support for comments. <a href="https://github.com/C2FO/fast-csv/issues/56">#56</a></li>
225234
</ul>
226-
<h1 id="v0-4-3">v0.4.3</h1>
235+
<h1>v0.4.3</h1>
227236
<ul>
228237
<li>Added ability to include a <code>rowDelimiter</code> at the end of a csv with the <code>includeEndRowDelimiter</code> option <a href="https://github.com/C2FO/fast-csv/issues/54">#54</a></li>
229238
<li>Added escaping for values that include a row delimiter</li>
230239
<li>Added more tests for new feature and escaping row delimiter values.</li>
231240
</ul>
232-
<h1 id="v0-4-2">v0.4.2</h1>
241+
<h1>v0.4.2</h1>
233242
<ul>
234243
<li>Added ability to specify a rowDelimiter when creating a csv.</li>
235244
<li>Added discardUnmappedColumns option to allow the ignoring of extra data <a href="https://github.com/C2FO/fast-csv/pull/45">#45</a></li>
236245
</ul>
237-
<h1 id="v0-4-1">v0.4.1</h1>
246+
<h1>v0.4.1</h1>
238247
<ul>
239248
<li>Fixed race condition that occurred if you called pause during a flush.</li>
240249
</ul>
241-
<h1 id="v0-4-0">v0.4.0</h1>
250+
<h1>v0.4.0</h1>
242251
<ul>
243252
<li>Fixed misspelling of <code>delimiter</code> <a href="https://github.com/C2FO/fast-csv/issues/40">#40</a></li>
244253
</ul>
245-
<h1 id="v0-3-1">v0.3.1</h1>
254+
<h1>v0.3.1</h1>
246255
<ul>
247256
<li>Added transform support to formatters<ul>
248257
<li>When using <code>createWriteStream</code> you can now you the <code>transform</code> method to specify a row transformer.</li>
249258
<li>When using other transform methods you can specify a <code>transform</code> option.</li>
250259
</ul>
251260
</li>
252261
</ul>
253-
<h1 id="v0-3-0">v0.3.0</h1>
262+
<h1>v0.3.0</h1>
254263
<ul>
255264
<li>You can now specify <code>objectMode</code> when parsing a csv which will cause <code>data</code> events to have an object emitted.</li>
256265
<li>You can now pipe directly to the stream returned from <code>createWriteStream</code></li>
257266
<li>You can now transform csvs by piping output from parsing into a formatter.</li>
258267
</ul>
259-
<h1 id="v0-2-5">v0.2.5</h1>
268+
<h1>v0.2.5</h1>
260269
<ul>
261270
<li>Fixed issue where not all rows are emitted when using <code>pause</code> and <code>resume</code></li>
262271
</ul>
263-
<h1 id="v0-2-4">v0.2.4</h1>
272+
<h1>v0.2.4</h1>
264273
<ul>
265274
<li>Added more fine grained control to <code>.pause</code> and <code>.resume</code><ul>
266275
<li>You can now pause resume between chunks</li>
267276
</ul>
268277
</li>
269278
</ul>
270-
<h1 id="v0-2-3">v0.2.3</h1>
279+
<h1>v0.2.3</h1>
271280
<ul>
272281
<li>Add new <code>createWriteStream</code> for creating a streaming csv writer</li>
273282
</ul>
274-
<h1 id="v0-2-2">v0.2.2</h1>
283+
<h1>v0.2.2</h1>
275284
<ul>
276285
<li>Fixed issue with having line breaks containing <code>\r\n</code></li>
277286
</ul>
278-
<h1 id="v0-2-1">v0.2.1</h1>
287+
<h1>v0.2.1</h1>
279288
<ul>
280289
<li>Fixed issue with <code>\r</code> line break in parser</li>
281290
</ul>
282-
<h1 id="v0-2-0">v0.2.0</h1>
291+
<h1>v0.2.0</h1>
283292
<ul>
284293
<li>Added multiline value support</li>
285294
<li>Updated escaping logic</li>
@@ -288,17 +297,17 @@ <h1 id="v0-2-0">v0.2.0</h1>
288297
<li>Removed support for having two quote types instead it just supports a single quote and escape sequence.
289298
Source code (zip)</li>
290299
</ul>
291-
<h1 id="v0-1-2">v0.1.2</h1>
300+
<h1>v0.1.2</h1>
292301
<ul>
293302
<li>Fixed issue with formatter handling undefined or null values.</li>
294303
<li>Changed formatter not not include a new line at the end of a CSV.</li>
295304
<li>Added pause and resume functionality to ParserStream</li>
296305
</ul>
297-
<h1 id="v0-1-1">v0.1.1</h1>
306+
<h1>v0.1.1</h1>
298307
<ul>
299308
<li>Added trim, ltrim, and rtrim to parsing options</li>
300309
</ul>
301-
<h1 id="v0-1-0">v0.1.0</h1>
310+
<h1>v0.1.0</h1>
302311

303312
<hr>
304313

docs/index.html

+16-16
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,13 @@
178178

179179

180180
<p><a href="http://travis-ci.org/C2FO/fast-csv"><img src="https://secure.travis-ci.org/C2FO/fast-csv.png" alt="build status"></a></p>
181-
<h1 id="fast-csv">Fast-csv</h1>
181+
<h1>Fast-csv</h1>
182182
<p>This is a library that provides CSV parsing and formatting.</p>
183183
<p><strong>NOTE</strong> As of v0.2.0 <code>fast-csv</code> supports multi-line values.</p>
184-
<h2 id="installation">Installation</h2>
184+
<h2>Installation</h2>
185185
<p><code>npm install fast-csv</code></p>
186-
<h2 id="usage">Usage</h2>
187-
<h3 id="parsing">Parsing</h3>
186+
<h2>Usage</h2>
187+
<h3>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>
@@ -350,12 +350,12 @@ <h3 id="parsing">Parsing</h3>
350350
.on(&quot;end&quot;, function(){
351351
console.log(&quot;done&quot;);
352352
});</code></pre>
353-
<h3 id="validating">Validating</h3>
353+
<h3>Validating</h3>
354354
<p>You can validate each row in the csv by providing a validate handler. If a row is invalid then a <code>data-invalid</code> event
355355
will be emitted with the row and the index.</p>
356356
<pre class='prettyprint linenums lang-js'><code class="lang-javascript">var stream = fs.createReadStream(&quot;my.csv&quot;);
357357

358-
csv(
358+
csv
359359
.fromStream(stream, {headers : true})
360360
.validate(function(data){
361361
return data.age &lt; 50; //all persons must be under the age of 50
@@ -389,7 +389,7 @@ <h3 id="validating">Validating</h3>
389389
.on(&quot;end&quot;, function(){
390390
console.log(&quot;done&quot;);
391391
});</code></pre>
392-
<h3 id="transforming">Transforming</h3>
392+
<h3>Transforming</h3>
393393
<p>You can transform data by providing a transform function. What is returned from the transform function will
394394
be provided to validate and emitted as a row.</p>
395395
<pre class='prettyprint linenums lang-js'><code class="lang-javascript">var stream = fs.createReadStream(&quot;my.csv&quot;);
@@ -419,7 +419,7 @@ <h3 id="transforming">Transforming</h3>
419419
.on(&quot;end&quot;, function(){
420420
console.log(&quot;done&quot;);
421421
});</code></pre>
422-
<h3 id="formatting">Formatting</h3>
422+
<h3>Formatting</h3>
423423
<p><code>fast-csv</code> also allows to you to create create a <code>CSV</code> from data.</p>
424424
<p>Formatting accepts the same options as parsing with an additional <code>transform</code> option.</p>
425425
<ul>
@@ -439,7 +439,7 @@ <h3 id="formatting">Formatting</h3>
439439
</ul>
440440
</li>
441441
</ul>
442-
<h3 id="data-types">Data Types</h3>
442+
<h3>Data Types</h3>
443443
<p>When creating a CSV <code>fast-csv</code> supports a few data formats.</p>
444444
<p><strong><code>Objects</code></strong></p>
445445
<p>You can pass in object to any formatter function if your csv requires headers the keys of the first object will be used as the header names.</p>
@@ -479,7 +479,7 @@ <h3 id="data-types">Data Types</h3>
479479
//Generated CSV
480480
//a,a,b,b,c,c
481481
//a1,a2,b1,b2,c1,c2</code></pre>
482-
<h3 id="formatting-functions">Formatting Functions</h3>
482+
<h3>Formatting Functions</h3>
483483
<p><strong><code>createWriteStream(options)</code> or <code>.format(options)</code></strong></p>
484484
<p>This is the lowest level of the write methods, it creates a stream that can be used to create a csv of unknown size and pipe to an output csv.</p>
485485
<pre class='prettyprint linenums lang-js'><code class="lang-javascript">var csvStream = csv.createWriteStream({headers: true}),
@@ -739,7 +739,7 @@ <h3 id="formatting-functions">Formatting Functions</h3>
739739
console.log(data); //&quot;A,B\na1,b1\na2,b2\n&quot;
740740
}
741741
);</code></pre>
742-
<h2 id="piping-from-parser-to-writer">Piping from Parser to Writer</h2>
742+
<h2>Piping from Parser to Writer</h2>
743743
<p>You can use <code>fast-csv</code> to pipe the output from a parsed CSV to a transformed CSV by setting the parser to <code>objectMode</code> and using <code>createWriteStream</code>.</p>
744744
<pre class='prettyprint linenums lang-js'><code class="lang-javascript">csv
745745
.fromPath(&quot;in.csv&quot;, {headers: true})
@@ -774,10 +774,10 @@ <h2 id="piping-from-parser-to-writer">Piping from Parser to Writer</h2>
774774
.fromPath(&quot;in.csv&quot;, {headers: true})
775775
.pipe(formatStream)
776776
.pipe(fs.createWriteStream(&quot;out.csv&quot;, {encoding: &quot;utf8&quot;}));</code></pre>
777-
<h2 id="quoting-columns">Quoting Columns</h2>
777+
<h2>Quoting Columns</h2>
778778
<p>Sometimes you may need to quote columns is certain ways in order meet certain requirements. <code>fast-csv</code> can quote columns and headers almost anyway you may need.</p>
779779
<p><strong>Note</strong> in the following example we use <code>writeToString</code> but the options option are valid for any of the formatting methods.</p>
780-
<h3 id="-quotecolumns-"><code>quoteColumns</code></h3>
780+
<h3><code>quoteColumns</code></h3>
781781
<pre class='prettyprint linenums lang-js'><code>//quote all columns including headers
782782
var objectData = [{a: &quot;a1&quot;, b: &quot;b1&quot;}, {a: &quot;a2&quot;, b: &quot;b2&quot;}],
783783
arrayData = [[&quot;a&quot;, &quot;b&quot;], [&quot;a1&quot;, &quot;b1&quot;], [&quot;a2&quot;, &quot;b2&quot;]];
@@ -800,7 +800,7 @@ <h3 id="-quotecolumns-"><code>quoteColumns</code></h3>
800800
//a1,&quot;b1&quot;
801801
//a2,&quot;b2&quot;
802802
});</code></pre>
803-
<h3 id="-quoteheaders-"><code>quoteHeaders</code></h3>
803+
<h3><code>quoteHeaders</code></h3>
804804
<pre class='prettyprint linenums lang-js'><code>//quote all columns including headers
805805
var objectData = [{a: &quot;a1&quot;, b: &quot;b1&quot;}, {a: &quot;a2&quot;, b: &quot;b2&quot;}],
806806
arrayData = [[&quot;a&quot;, &quot;b&quot;], [&quot;a1&quot;, &quot;b1&quot;], [&quot;a2&quot;, &quot;b2&quot;]];
@@ -832,9 +832,9 @@ <h3 id="-quoteheaders-"><code>quoteHeaders</code></h3>
832832
//&quot;a1&quot;,&quot;b1&quot;
833833
//&quot;a2&quot;,&quot;b2&quot;
834834
});</code></pre>
835-
<h2 id="license">License</h2>
835+
<h2>License</h2>
836836
<p>MIT <a href="https://github.com/C2FO/fast-csv/raw/master/LICENSE">https://github.com/C2FO/fast-csv/raw/master/LICENSE</a></p>
837-
<h2 id="meta">Meta</h2>
837+
<h2>Meta</h2>
838838
<ul>
839839
<li>Code: <code>git clone git://github.com/C2FO/fast-csv.git</code></li>
840840
<li>Website: <a href="http://c2fo.com">http://c2fo.com</a></li>

0 commit comments

Comments
 (0)