CSVParse for Node.js

IssuesGitHub

Option relax_quotes

Table of Contents

The relax_quotes option preserves quotes inside unquoted field.

Usage

The second field is not quoted and it contains a quote character inside:

import assert from 'assert';
import { parse } from 'csv-parse';

parse(`
a,some"text,c
`.trim(), {
  relax_quotes: true
}, (err, records) => {
  assert.deepStrictEqual(records, [
    ['a', 'some"text', 'c']
  ]);
});