Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fast-csv

Package Overview
Dependencies
Maintainers
2
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-csv - npm Package Compare versions

Comparing version 2.1.0 to 2.2.0

.idea/fast-csv.iml

6

History.md

@@ -1,3 +0,7 @@

# v2.1.1
# v2.2.0
* Handle split CRLF [#156](https://github.com/C2FO/fast-csv/pull/156) - [@alexeits](https://github.com/alexeits)
# v2.1.0
* Now handles tab delimited CSVs with only spaces for field values

@@ -4,0 +8,0 @@ * Handles CSVs with only spaces for field values

12

lib/parser/parser.js

@@ -146,6 +146,7 @@ var extended = require("./../extended"),

function getNextToken(line, cursor) {
var token, nextIndex, subStr = line.substr(cursor);
var token, tokenLen, nextIndex, subStr = line.substr(cursor);
if ((nextIndex = subStr.search(NEXT_TOKEN_REGEXP)) !== -1) {
token = line[cursor += nextIndex];
cursor += subStr.match(NEXT_TOKEN_REGEXP)[1].length - 1;
tokenLen = subStr.match(NEXT_TOKEN_REGEXP)[1].length;
token = line.substr(cursor + nextIndex, tokenLen);
cursor += nextIndex + tokenLen - 1;
}

@@ -171,2 +172,7 @@ return {token: token, cursor: cursor};

} else {
// if ends with CR and there is more data, keep unparsed due to possible coming LF in CRLF
if (token === '\r' && hasMoreData) {
i = lastLineI;
cursor = null;
}
break;

@@ -173,0 +179,0 @@ }

{
"name": "fast-csv",
"version": "2.1.0",
"version": "2.2.0",
"description": "CSV parser and writer",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -83,3 +83,3 @@ [![build status](https://secure.travis-ci.org/C2FO/fast-csv.png)](http://travis-ci.org/C2FO/fast-csv)

```
```javascript
var fileStream = fs.createReadStream("my.csv"),

@@ -328,3 +328,3 @@ parser = fastCsv();

`fast-csv` also allows to you to create create a `CSV` from data.
`fast-csv` also allows you to create a `CSV` from data.

@@ -353,3 +353,3 @@ Formatting accepts the same options as parsing with an additional `transform` option.

```
```javascript
[

@@ -372,3 +372,3 @@ {

```
```javascript
[

@@ -387,3 +387,3 @@ ["a", "b", "c"],

```
```javascript
[

@@ -592,3 +592,3 @@ [

**`writeToStream(stream,arr[, options])`**
**`writeToStream(stream, arr[, options])`**

@@ -787,3 +787,3 @@ Write an array of values to a `WritableStream`

```
```javascript
//quote all columns including headers

@@ -816,3 +816,3 @@ var objectData = [{a: "a1", b: "b1"}, {a: "a2", b: "b2"}],

```
```javascript
//quote all columns including headers

@@ -819,0 +819,0 @@ var objectData = [{a: "a1", b: "b1"}, {a: "a2", b: "b2"}],

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc