Edition 6 of the csv
package for Node.js is released alongside its sub jobs. Below are the latest variations:
csv
version6..
, newest version was5.5.3
csv-generate
version4..
, most up-to-date variation was3.4.3
csv-parse
model5..
, most current edition was4.16.3
csv-stringify
model6..
, hottest variation was5.6.5
stream-completely transform
version4..
, newest variation was2.1.3
There has been a good deal of commits since the final package deal was unveiled, all over 100, way to a lot of to my opinion. Most of the endeavours were on migrating to ECMAScript modules (ESM) and offering a strong build infrastructure based mostly on Rollup. The site has been current and enriched with numerous examples.
Prior to presenting the new features, listed here are the breaking changes to start with. Some module names have changed depending on your specific natural environment. The documentation now delivers extensive information and facts and samples on this subject matter. Also, some possibilities ended up renamed in the csv-parse
deal. There are not too quite a few:
- CommonJS end users shall update the path to the sync modules, from
package deal_identify/lib/sync
topackage deal_title/sync
. - Imports are generally destructed, eg
import parse from 'csv-parse'
, there are now default exports. - In the
csv-parse
deal, selectionloosen up
was renamedtake it easy_rates
. - In the
csv-parse
bundle, possibilityskip_lines_with_empty_values
was renamedskip_data_with_empty_values
. - In the
csv-parse
deal, optionskip_strains_with_error
was renamedskip_records_with_error
. - In the
csv-parse
bundle, mistakeCSV_History_DONT_MATCH_COLUMNS_Duration
was renamedCSV_File_INCONSISTENT_COLUMNS
. - In the
csv-parse
bundle, errorINCONSISTENT_Report_Length
was renamedFile_INCONSISTENT_FIELDS_Duration
.
Listed here are the key options:
- All assignments and modules are now published as ECMAScript modules.
- Clear usage concerning CommonJS and ESM with package deal.json
exports
property - Wrote a lot of samples integrated with the documentation internet site
- Switch the browser distribution with the IIFE distribution produced by Rollup
- New UMD distribution
- Integrate lint regulations on all js and espresso documents
- Backport compatibility with Node.js 8 in
csv-stringify
- In
csv-parse
, print current buffer with choicesskip_line_with_glitches
andraw
- In
csv-parse
, optionobjname
can now refer to index situation - A couple TypeScript enhancements
In this article is a speedy case in point illustrating some of the variations, utilizing the csv-parse/lib/sync
module. In the previous launch, the code looked like:
const parse = involve('csv-parse/lib/sync')
const documents = parse('a, "b" ,c',
relax: real
)
In the most recent launch, the up-to-date code is now:
// `parse` is now destructured, it is consistent with
// `const parse = require('csv/sync')` if you are working with the `csv` deal.
// Also, the path to the sync module is now 'csv-parse/sync'
const parse = have to have('csv-parse/sync')
const information = parse('a, "b" ,c',
// `relax` was renamed `relax_quotes`, this is a single of the number of choices from
// `csv-parse` which were renamed.
chill out_prices: accurate
)
Please report bugs and propose attributes to the CSV repository on GitHub.