CSV package for Node.js version 6
Edition 6 of the csv package for Node.js is launched together its sub tasks. In this article are the newest variations:
csvedition6.., newest model was5.5.3
csv-generatemodel4.., newest version was3.4.3
csv-parsevariation5.., hottest variation was4.16.3
csv-stringifyversion6.., latest variation was5.6.5
stream-renovatevariation4.., most recent edition was2.1.3
There has been a large amount of commits considering the fact that the previous deal was launched, around 100, way to a lot of to my view. Most of the endeavours were being on migrating to ECMAScript modules (ESM) and supplying a robust establish infrastructure dependent on Rollup. The site has been current and enriched with many illustrations.
Right before presenting the new features, in this article are the breaking variations to start with. Some module names have adjusted based on your qualified ecosystem. The documentation now gives comprehensive facts and samples on this matter. Also, some alternatives ended up renamed in the csv-parse package. There aren’t too numerous:
- CommonJS end users shall update the path to the sync modules, from
package deal_title/lib/synctodeal_title/sync. - Imports are constantly destructed, eg
import parse from 'csv-parse', there are now default exports. - In the
csv-parsepackage, possibilityunwindwas renamedrest_prices. - In the
csv-parsepackage deal, selectionskip_traces_with_empty_valueswas renamedskip_documents_with_empty_values. - In the
csv-parseoffer, choiceskip_lines_with_errorwas renamedskip_data_with_mistake. - In the
csv-parsepackage, errorCSV_History_DONT_MATCH_COLUMNS_Lengthwas renamedCSV_File_INCONSISTENT_COLUMNS. - In the
csv-parsedeal, mistakeINCONSISTENT_Record_Sizewas renamedFile_INCONSISTENT_FIELDS_Length.
Right here are the key attributes:
- All tasks and modules are now written as ECMAScript modules.
- Transparent utilization in between CommonJS and ESM with offer.json
exportsresidence - Wrote lots of samples integrated with the documentation web page
- Change the browser distribution with the IIFE distribution generated by Rollup
- New UMD distribution
- Combine lint regulations on all js and espresso documents
- Backport compatibility with Node.js 8 in
csv-stringify - In
csv-parse, print present-day buffer with solutionsskip_line_with_glitchesanduncooked - In
csv-parse, possibilityobjnamecan now refer to index place - A couple of TypeScript enhancements
In this article is a brief instance illustrating some of the alterations, employing the csv-parse/lib/sync module. In the earlier launch, the code seemed like:
const parse = need('csv-parse/lib/sync')
const documents = parse('a, "b" ,c',
chill out: real
)
In the most up-to-date launch, the up-to-date code is now:
// `parse` is now destructured, it is regular with
// `const parse = have to have('csv/sync')` if you are employing the `csv` package.
// Also, the path to the sync module is now 'csv-parse/sync'
const parse = involve('csv-parse/sync')
const information = parse('a, "b" ,c',
// `relax` was renamed `relax_quotes`, this is one particular of the few choices from
// `csv-parse` which were renamed.
relax_quotations: true
)
You should report bugs and suggest functions to the CSV repository on GitHub.
