Browse Source

Minor docs improvements; mostly about pause/resume

pull/89/head
Matthew Holt 11 years ago
parent
commit
ca176ab8f8
  1. 2
      docs.html
  2. 20
      faq.html

2
docs.html

@ -327,7 +327,7 @@ var csv = Papa.unparse({
<li><code>header</code> If true, the first row of parsed data will be interpreted as field names. Fields will be returned in the <a href="#meta">meta</a>, and each row will be an object of data keyed by field name. If false, the parser simply returns an array of arrays, including the first row.</li> <li><code>header</code> If true, the first row of parsed data will be interpreted as field names. Fields will be returned in the <a href="#meta">meta</a>, and each row will be an object of data keyed by field name. If false, the parser simply returns an array of arrays, including the first row.</li>
<li><code>dynamicTyping</code> If true, numeric and boolean data will be converted to their type instead of remaining strings.</li> <li><code>dynamicTyping</code> If true, numeric and boolean data will be converted to their type instead of remaining strings.</li>
<li><code>preview</code> If > 0, only that many rows will be parsed.</li> <li><code>preview</code> If > 0, only that many rows will be parsed.</li>
<li> <li id="step">
<code>step</code> To <a href="faq.html#streaming">stream</a> the input, define a callback function to receive <a href="#results">results</a> row-by-row rather than together at the end: <code>step</code> To <a href="faq.html#streaming">stream</a> the input, define a callback function to receive <a href="#results">results</a> row-by-row rather than together at the end:
<code class="block">step: function(results, handle) { <code class="block">step: function(results, handle) {
console.log("Row data:", results.data); console.log("Row data:", results.data);

20
faq.html

@ -50,7 +50,7 @@
<main> <main>
<div class="grid-container"> <div class="grid-container">
<h2>Detailed FAQ</h2> <h2>FAQ</h2>
<div class="prefix-20 grid-60 suffix-20"> <div class="prefix-20 grid-60 suffix-20">
@ -67,11 +67,16 @@
Privacy advocates also use Papa Parse to avoid having to transmit sensitive files over the Internet. Now all the processing can be done locally on the client's computer. This is especially significant considering some organizations' policies. Privacy advocates also use Papa Parse to avoid having to transmit sensitive files over the Internet. Now all the processing can be done locally on the client's computer. This is especially significant considering some organizations' policies.
</p> </p>
<h4>Can I use Papa Parse server-side with Node.js?</h4>
<h4>Demo? Testing?</h4> <p>
There's a fork of Papa called <a href="https://github.com/Rich-Harris/BabyParse" target="_blank">Baby Parse</a> which is <a href="https://www.npmjs.org/package/babyparse">published on npm</a>. Some features are unavailable (like worker threads and file opening/downloading), but the core parser is fully functional.
</p>
<h4>Does Papa Parse have any dependencies?</h4>
<p> <p>
There's the <a href="demo.html">online demo</a> or you can download and use the player file in the GitHub repository for testing. You'll also find actual tests there that keep Papa strong. No. Papa Parse has no dependencies. If jQuery is present, however, it plugs in to make it easier to select files from the DOM.
</p> </p>
@ -84,6 +89,7 @@
<h4>Is it open source? (Can I contribute something?)</h4> <h4>Is it open source? (Can I contribute something?)</h4>
<p> <p>
@ -149,6 +155,12 @@
Streaming remote files also requires the Content-Range header in the server's response. Most production-ready servers support this header, but for example, Python's SimpleHTTPServer does not. Streaming remote files also requires the Content-Range header in the server's response. Most production-ready servers support this header, but for example, Python's SimpleHTTPServer does not.
</p> </p>
<h4>Can I pause and resume parsing?</h4>
<p>
Yes, as long as you are streaming and not using a worker. Your <a href="/docs.html#step">step callback</a> is passed a ParserHandle which has pause, resume, and abort functions.
</p>
@ -172,7 +184,7 @@
<h4>When should I use a worker?</h4> <h4>When should I use a worker?</h4>
<p> <p>
That's up to you. The most typical reason to use a web worker is if your web page becomes unresponsive during parsing. In other words, it freezes: you can't click things or the scrolling becomes choppy. Some browsers, like Firefox, will warn the user that a script has become unresponsive or is taking a long time (even if it's working properly). If this happens to you or some of your users, consider using a web worker, at least for the large inputs. That's up to you. The most typical reason to use a web worker is if your web page becomes unresponsive during parsing. In other words, if it freezes and you can't click things or the scrolling becomes choppy. If that happens, some browsers (like Firefox) will warn the user that a script has become unresponsive or is taking a long time (even if it's working properly). If this happens to you or some of your users, consider using a web worker, at least for the large inputs.
</p> </p>
<p> <p>

Loading…
Cancel
Save