Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
5e92fca
Add Retool to PapaParse lovers list (#867)
likejane Apr 20, 2021
113d561
Update ISO_DATE regex to match full string (#872)
thebetternewt May 28, 2021
eaeb01a
Minor version bump
May 28, 2021
0f75aeb
Remove travis CI config file
Jun 9, 2021
a6fdfcb
Remove support for node10 (#876)
Jun 9, 2021
23e1b47
- fixes multi-character delimiter with quoted field issue (#879)
janisdd Jun 18, 2021
26a86fd
Do not run tests on node15
Dec 9, 2021
1f2c733
Add more cases to escapeFormulae and allow to pass RegExp (#904)
caub Dec 10, 2021
997c692
Remove broken links from lovers
Mar 4, 2022
ec36ab2
Upgrade mocha-headless-chrome
dangreen Mar 14, 2022
e420595
Add support for node16 (#877)
Mar 14, 2022
6bb7c33
Add usage stats on lovers page
Mar 14, 2022
8dba33e
Set empty string to config.quotechar when it's value is null (#925)
chafi9-code Mar 14, 2022
4132d81
fixcolumns config works with input type object (#919)
TheSlimvReal Mar 15, 2022
a93c5c9
Improve row skipping performance (#911) (#912)
bezrodnov Mar 15, 2022
e11ee26
Minor version bump
Mar 15, 2022
bb1ca4e
Remove support for node12
Jun 10, 2022
c19cd2d
Add support for node18 (#938)
Jun 10, 2022
0772457
[GH-788] Made the check to determine whether the current web-worker i…
flakey-bit Jun 14, 2022
bf19955
Add vertex.io to lovers (#958)
cjroth Nov 9, 2022
bde83f5
Fix iso-date regex (#959)
ChALkeR Nov 14, 2022
c1cbe16
Rename duplicate headers (#956)
fortydegrees Nov 15, 2022
aa00468
Handle parsing utf-8 bom encoded files (#961)
peteruithoven Nov 25, 2022
db230fc
Minor version bump
Mar 2, 2023
970c1db
Rename duplicated headers
Mar 14, 2023
824bbd9
Only test duplicate headers on first row
Mar 17, 2023
e728bfe
Remove jsperf.com links from README.md. (#986)
simi Mar 23, 2023
3e7c4bc
Bugfix version bump
Mar 23, 2023
1f6cc9c
Update minium es version to 6
Mar 31, 2023
3a32901
Faster headerMap to find duplicated headers (#991)
dubzzz Mar 31, 2023
e14a838
feat: renamed headers meta (#990)
jchen042 Apr 5, 2023
30bab45
Use for loop for header parsing to only interate over array elements …
ponny Apr 11, 2023
713f7d8
Add DocTemple to lovers.js (#996)
janswist Apr 11, 2023
b536555
Fixed cursor when duplicated header (#997)
jsakaicribl Apr 13, 2023
841e1d4
Add usage example (#1002)
camiblanch Jun 2, 2023
f1d10ee
Manage boolean values in escapeFormule setting (#1025)
sp94 Oct 9, 2023
e2d570e
Allow to skip first lines #738 (#1021)
bhuvaneshwararaja Oct 9, 2023
fbaeca2
Add language hints to the README examples (#1034)
khill-fbmc Dec 18, 2023
a67ed3f
Improve readability on dynamicTyping option (#1041)
maon-fp Feb 19, 2024
a39383e
Update papaparse link in package.json to use HTTPS (#1044)
domdomegg Mar 5, 2024
016effe
Add hellodata success story (#1047)
nlassaux Mar 27, 2024
a116779
Add missing space after readme link in faq (#1060)
NReilingh Jul 11, 2024
cf4bded
Only skip first n lines in the first chunk and don't take the first l…
jkruke Aug 5, 2024
4af6882
Refactor header renaming logic to adress #1052, #1007 (#1058)
augustmarowski Sep 12, 2024
f490abb
Remove ES6 features to allow minifying paparse file
pokoli Jan 9, 2025
338af86
Minor version bump
pokoli Jan 9, 2025
4dca570
Run build script in CI
pokoli Jan 10, 2025
9c42a1e
Update grunt-contrib-uglify version
pokoli Jan 10, 2025
d206124
Revert "Remove ES6 features to allow minifying paparse file"
pokoli Jan 10, 2025
d0f58aa
Patch version bump
pokoli Jan 10, 2025
954c2a5
Fix package URL
pokoli Jan 10, 2025
44c5686
Only attempt to parse headers once (#1086)
guseggert Jan 28, 2025
c7e8321
Do not run headless tests on CI (#1087)
pokoli Jan 28, 2025
e3c7b26
Patch version bump
pokoli Jan 28, 2025
0eb59a0
Avoid infinite loop with duplicate counting (#1095)
aszx87410 May 19, 2025
a4f8b0f
Patch version bump
pokoli May 19, 2025
08265f1
Strip BOM character from column keys when parsing header
baumschubser May 30, 2025
530357f
Update Node versions (#1097)
gabegorelick Jun 18, 2025
58bcb73
Mention BYTE_ORDER_MARK in documentation (#1096)
forivall Jul 29, 2025
8ecc42d
confirms issue 1024 is resolveD
dboskovic Aug 11, 2025
565d821
Merge pull request #1102 from mholt/fix/issue-1024
dboskovic Aug 11, 2025
b10b87e
Use https on readme links (#1104)
Schweinepriester Aug 20, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
module.exports = {
"parserOptions": {
"ecmaVersion": 5
"ecmaVersion": 6
},
"env": {
"es6": true,
"browser": true,
"worker": true,
"node": true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
node-version: [20.x, 22.x, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/

steps:
Expand All @@ -26,4 +26,4 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm install
- run: npm test
- run: npm run lint && npm run test-node && npm run build
6 changes: 0 additions & 6 deletions .travis.yml

This file was deleted.

26 changes: 18 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
Parse CSV with JavaScript
========================================

Papa Parse is the [fastest](http://jsperf.com/javascript-csv-parsers/4) in-browser CSV (or delimited text) parser for JavaScript. It is reliable and correct according to [RFC 4180](https://tools.ietf.org/html/rfc4180), and it comes with these features:
Papa Parse is the fastest in-browser CSV (or delimited text) parser for JavaScript. It is reliable and correct according to [RFC 4180](https://tools.ietf.org/html/rfc4180), and it comes with these features:

- Easy to use
- Parse CSV files directly (local or over the network)
- Fast mode ([is really fast](http://jsperf.com/javascript-csv-parsers/3))
- Fast mode
- Stream large files (even via HTTP)
- Reverse parsing (converts JSON to CSV)
- Auto-detect delimiter
Expand All @@ -23,21 +23,31 @@ Install

papaparse is available on [npm](https://www.npmjs.com/package/papaparse). It
can be installed with the following command:

npm install papaparse
```shell
npm install papaparse
```

If you don't want to use npm, [papaparse.min.js](https://unpkg.com/papaparse@latest/papaparse.min.js) can be downloaded to your project source.

Usage
-----
```js
import Papa from 'papaparse';

Papa.parse(file, config);

const csv = Papa.unparse(data[, config]);
```

Homepage & Demo
----------------

- [Homepage](http://papaparse.com)
- [Demo](http://papaparse.com/demo)
- [Homepage](https://www.papaparse.com)
- [Demo](https://www.papaparse.com/demo)

To learn how to use Papa Parse:

- [Documentation](http://papaparse.com/docs)
- [Documentation](https://www.papaparse.com/docs)

The website is hosted on [Github Pages](https://pages.github.com/). Its content is also included in the docs folder of this repository. If you want to contribute on it just clone the master of this repository and open a pull request.

Expand All @@ -52,7 +62,7 @@ Papa Parse can also parse in a node streaming style which makes `.pipe` availabl
Get Started
-----------

For usage instructions, see the [homepage](http://papaparse.com) and, for more detail, the [documentation](http://papaparse.com/docs).
For usage instructions, see the [homepage](https://www.papaparse.com) and, for more detail, the [documentation](https://www.papaparse.com/docs).

Tests
-----
Expand Down
37 changes: 28 additions & 9 deletions docs/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ <h5>Unparse Config Options</h5>
<code>delimiter</code>
</td>
<td>
The delimiting character. It must not be found in <a href="#readonly">Papa.BAD_DELIMITERS</a>.
The delimiting character. Multi-character delimiters are supported. It must not be found in <a href="#readonly">Papa.BAD_DELIMITERS</a>.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -343,7 +343,7 @@ <h5>Unparse Config Options</h5>
<code>escapeFormulae</code>
</td>
<td>
If <code>true</code>, field values that begin with <code>=</code>, <code>+</code>, <code>-</code>, or <code>@</code>, will be prepended with a <code>'</code> to defend against <a href="https://www.contextis.com/en/blog/comma-separated-vulnerabilities" target="_blank" rel="noopener">injection attacks</a>, because Excel and LibreOffice will automatically parse such cells as formulae.
If <code>true</code>, field values that begin with <code>=</code>, <code>+</code>, <code>-</code>, <code>@</code>, <code>\t</code>, or <code>\r</code>, will be prepended with a <code>'</code> to defend against <a href="https://owasp.org/www-community/attacks/CSV_Injection" target="_blank" rel="noopener">injection attacks</a>, because Excel and LibreOffice will automatically parse such cells as formulae. You can override those values by setting this option to a regular expression
</td>
</tr>
</table>
Expand Down Expand Up @@ -450,7 +450,8 @@ <h5 id="config-default">Default Config With All Options</h5>
beforeFirstChunk: undefined,
withCredentials: undefined,
transform: undefined,
delimitersToGuess: [',', '\t', '|', ';', <a href="#readonly">Papa.RECORD_SEP</a>, <a href="#readonly">Papa.UNIT_SEP</a>]
delimitersToGuess: [',', '\t', '|', ';', <a href="#readonly">Papa.RECORD_SEP</a>, <a href="#readonly">Papa.UNIT_SEP</a>],
skipFirstNLines: 0
}</code></pre>
</div>
<div class="clear"></div>
Expand All @@ -470,7 +471,7 @@ <h5 id="config-details">Config Options</h5>
<code>delimiter</code>
</td>
<td>
The delimiting character. Leave blank to auto-detect from a list of most common delimiters, or any values passed in through <code>delimitersToGuess</code>. It can be a string or a function. If string, it must be one of length 1. If a function, it must accept the input as first parameter and it must return a string which will be used as delimiter. In both cases it cannot be found in <a href="#readonly">Papa.BAD_DELIMITERS</a>.
The delimiting character. Leave blank to auto-detect from a list of most common delimiters, or any values passed in through <code>delimitersToGuess</code>. It can be a string or a function. If a string, it can be of any length (so multi-character delimiters are supported). If a function, it must accept the input as first parameter and it must return a string which will be used as delimiter. In both cases it cannot be found in <a href="#readonly">Papa.BAD_DELIMITERS</a>.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -502,7 +503,8 @@ <h5 id="config-details">Config Options</h5>
<code>header</code>
</td>
<td>
If true, the first row of parsed data will be interpreted as field names. An array of field names will be returned in <a href="#meta">meta</a>, and each row of data will be an object of values keyed by field name instead of a simple array. Rows with a different number of fields from the header row will produce an error. Warning: Duplicate field names will overwrite values in previous fields having the same name.
If true, the first row of parsed data will be interpreted as field names. An array of field names will be returned in <a href="#meta">meta</a>, and each row of data will be an object of values keyed by field name instead of a simple array. Rows with a different number of fields from the header row will produce an error.
Warning: Duplicated field names will be automatically renamed to avoid values in previous fields having the same name to be overwritten. Renamed fields with original (or transformed by <code>transformHeader</code>) are stored in <code>ParseResult.meta.renamedHeaders</code>
</td>
</tr>
<tr>
Expand All @@ -519,7 +521,7 @@ <h5 id="config-details">Config Options</h5>
<code>dynamicTyping</code>
</td>
<td>
If true, numeric and boolean data will be converted to their type instead of remaining strings. Numeric data must conform to the definition of a decimal literal. Numerical values greater than <code>2^53</code> or less than <code>-2^53</code> will not be converted to numbers to preserve precision. European-formatted numbers must have commas and dots swapped. If also accepts an object or a function. If object it's values should be a boolean to indicate if dynamic typing should be applied for each column number (or header name if using headers). If it's a function, it should return a boolean value for each field number (or name if using headers) which will be passed as first argument.
If true, numeric and boolean data will be converted to their type instead of remaining strings. Numeric data must conform to the definition of a decimal literal. Numerical values greater than <code>2^53</code> or less than <code>-2^53</code> will not be converted to numbers to preserve precision. European-formatted numbers must have commas and dots swapped. It also accepts an object or a function. If it's an object, its values should be a boolean to indicate if dynamic typing should be applied for each column number (or header name if using headers). If it's a function, it should return a boolean value for each field number (or name if using headers) which will be passed as first argument.
</td>
</tr>
<tr>
Expand Down Expand Up @@ -681,6 +683,14 @@ <h5 id="config-details">Config Options</h5>
An array of delimiters to guess from if the <code>delimiter</code> option is not set.
</td>
</tr>
<tr>
<td>
<code>skipFirstNLines</code>
</td>
<td>
To skip first N number of lines when converting a CSV file to JSON
</td>
</tr>
</table>
</div>
</div>
Expand Down Expand Up @@ -759,11 +769,13 @@ <h5 id="data">Data</h5>
[
{
"Column 1": "foo",
"Column 2": "bar"
"Column 2": "bar",
"Column 1": "foo1",
},
{
"Column 1": "abc",
"Column 2": "def"
"Column 2": "def",
"Column 1": "abc1",
}
]</code></pre>
</div>
Expand Down Expand Up @@ -811,6 +823,7 @@ <h5 id="meta">Meta</h5>
aborted: // Whether process was aborted
fields: // Array of field names
truncated: // Whether preview consumed all input
renamedHeaders: // Headers that are automatically renamed by the library to avoid duplication. {Column 1_1: 'Column 1' // the later header 'Column 1' was renamed to 'Column 1_1'}
}</code></pre>
</div>
<div class="grid-50">
Expand Down Expand Up @@ -861,7 +874,13 @@ <h5 id="readonly">Read-Only</h5>
<tr>
<td><code>Papa.BAD_DELIMITERS</code></td>
<td>
An array of characters that are not allowed as delimiters.
An array of characters that are not allowed as delimiters (<code>\r, \n, ", \ufeff</code>).
</td>
</tr>
<tr>
<td><code>Papa.BYTE_ORDER_MARK</code></td>
<td>
The unicode <a href="https://en.wikipedia.org/wiki/Byte_order_mark">Byte Order Mark</a> (<code>\ufeff</code>).
</td>
</tr>
<tr>
Expand Down
2 changes: 1 addition & 1 deletion docs/faq.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h6 id="why">Why use Papa Parse?</h6>
</p>

<h6 id="nodejs">Can I use Papa Parse server-side with Node.js?</h6>
<p>Yes, Paparse supports Node. See <a href="https://github.com/mholt/PapaParse/blob/master/README.md#papa-parse-for-node" target="_blank">our README</a>for further details.
<p>Yes, Paparse supports Node. See <a href="https://github.com/mholt/PapaParse/blob/master/README.md#papa-parse-for-node" target="_blank">our README</a> for further details.
</p>

<h6 id="dependencies">Does Papa Parse have any dependencies?</h6>
Expand Down
18 changes: 18 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,24 @@ <h3>Features</h3>
<div class="grid-100 text-center">
<h3>People <i class="fa fa-heart"></i> Papa</h3>
</div>
<div class="grid-100 text-center">
<br>
<p>
<a href="https://www.npmjs.com/package/papaparse">
<img
src="https://img.shields.io/npm/dm/papaparse.svg"
alt="PapaParse"
/>
</a>
&nbsp;
<a href="https://www.npmjs.com/package/react-papaparse">
<img
src="https://img.shields.io/npm/dt/papaparse.svg?label=total%20downloads"
alt="PapaParse"
/>
</a>
</p>
</div>

<div class="grid-33">
<p class="lover">
Expand Down
48 changes: 24 additions & 24 deletions docs/resources/js/lovers.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,18 @@
**/

var peopleLovePapa = [
{
link: "http://doctempleapp.com",
name: "DocTemple",
description: "helps you effortlessly populate .docx documents with .csv data using scalable templating solution.",
quote: "Papa Parse made it extremely easy to load user CSV files in the browser. Implementing it was a breeze and it works perfect!"
},
{
link: "https://www.vertex.io",
name: "The no-code database of the future.",
description: "No-code, Postgres-powered admin, internal tools, and backend suite.",
quote: "Vertex uses Papa to power all CSV related features!"
},
{
link: "https://www.circlehd.com",
name: "CircleHD Enterprise Video Platform",
Expand Down Expand Up @@ -55,24 +67,6 @@ var peopleLovePapa = [
name: "Wikipedia",
description: "uses Papa Parse in VisualEditor to help article editors effortlessly build data tables from text files."
},
{
link: "https://www.webucator.com/webdesign/javascript.cfm",
name: "Webucator",
description: "created a video showing how to use Papa Parse and FileDrop.js to create a drag-and-drop CSV-JSON converter.",
quote: "It's often easy to convert data to CSV. With Papa, it's easy to turn that CSV into JSON."
},
{
link: "http://www.yolpo.com/social/gist.github?1dbd4556e748bdb830b3&autoplay=1&interimresults=0&failfast=1",
name: "Yolpo",
description: "created a simple regression test for Papa Parse.",
quote: "Papa's API is so intuitive, it took me no time to get it to work."
},
{
link: "https://www.appstax.com",
name: "Appstax",
description: "uses Papa Parse to import and export CSV data in their visual databrowser.",
quote: "Papa is a great for parsing CSV. And what a great tone of voice - love it!"
},
{
link: "https://github.com/Nanofus/novel.js",
name: "Novel.js",
Expand All @@ -97,12 +91,6 @@ var peopleLovePapa = [
description: "is a brand-new messaging app made specifically for busy families. Automatically align all family members when sending text messages to parents in the kindergarten or school or when planning your kids birthday parties.",
quote: "With Papa it was a joy to implement our tool for importing messages and places from external systems."
},
{
link: "https://explore.hua-gallery.com",
name: "Hua Explore",
description: "The premier destination for information on Contemporary Chinese Art.",
quote: "Papa makes processing data that galleries send us totally seamless."
},
{
link: "https://monei.net",
name: "MONEI",
Expand All @@ -126,5 +114,17 @@ var peopleLovePapa = [
name: "Visa SOP Sample",
description: "Providing free guide to international students.",
quote: "Use Papa Parse for many of side projects. Super fast and works all the time. Love it!"
},
{
link: "https://retool.com/",
name: "Retool",
description: "A remarkably fast way to build internal tools.",
quote: "Papa makes it easy for our users to customize CSV parsing to match their business logic."
},
{
link: "https://www.hellodata.ai/",
name: "HelloData",
description: "Automatic rent surveys with real-time data on over 25M multifamily units nationwide, direct from property websites.",
quote: "Papa Parse makes bulk data imports a breeze! It's helped us easily onboard our largest customers. It's robust and a true game-changer."
}
];
Loading