CSV package for Node.js version 6
Edition 6 of the csv package for Node.js is released alongside its sub jobs. Below are the latest variations:
csvversion6.., newest version was5.5.3
csv-generateversion4.., most up-to-date variation was3.4.3
csv-parsemodel5.., most current edition was4.16.3
csv-stringifymodel6.., hottest variation was5.6.5
stream-completely transformversion4.., 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/synctopackage deal_title/sync. - Imports are generally destructed, eg
import parse from 'csv-parse', there are now default exports. - In the
csv-parsedeal, selectionloosen upwas renamedtake it easy_rates. - In the
csv-parsebundle, possibilityskip_lines_with_empty_valueswas renamedskip_data_with_empty_values. - In the
csv-parsedeal, optionskip_strains_with_errorwas renamedskip_records_with_error. - In the
csv-parsebundle, mistakeCSV_History_DONT_MATCH_COLUMNS_Durationwas renamedCSV_File_INCONSISTENT_COLUMNS. - In the
csv-parsebundle, errorINCONSISTENT_Report_Lengthwas 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
exportsproperty - 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_glitchesandraw - In
csv-parse, optionobjnamecan 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.
