]> git.ardis.lu - csvio/tag
v0.1.4
object d2916a0629eeea1b404d16d8abcd36e64e8bc17f
authorArdis Lu <ardisglu@gmail.com>
Mon, 14 Jul 2025 05:01:29 +0000 (22:01 -0700)
Release v0.1.4

**Type exports**: All types are now exported and accessible by end-users. This change improves the developer experience when defining inputs and options.

JavaScript example (JSDoc):

```javascript
import { CSVReader, CSVTransformer, CSVWriter } from '@ardislu/csvio';
/** @import { TransformationFunction, CSVTransformerOptions } from '@ardislu/csvio'; */

/** @type {TransformationFunction} */
function calculate(r) {
  return r;
}

/** @type {CSVTransformerOptions} */
const options = {
  handleHeaders: ['a', 'b']
}

new CSVReader('./in.csv')
  .pipeThrough(new CSVTransformer(calculate, options))
  .pipeTo(new CSVWriter('./out.csv'));
```

TypeScript example:

```typescript
import { CSVReader, CSVTransformer, CSVWriter, TransformationOutput, CSVTransformerOptions } from '@ardislu/csvio';

function calculate(r: any[]): TransformationOutput {
  return r;
}

const options: CSVTransformerOptions = {
  handleHeaders: ['a', 'b']
}

new CSVReader('./in.csv')
  .pipeThrough(new CSVTransformer(calculate, options))
  .pipeTo(new CSVWriter('./out.csv'));
```

**New `useLiteralNames` option for `CSVNormalizer`**: By default, `CSVNormalizer` will convert `CSVNormalizerHeader` column names and CSV input column names to camelCase to correct for common naming mistakes when CSV files are manually manipulated (e.g., `Column A` and `column A` are considered the same). This behavior can now be disabled by passing `useLiteralNames: true` to `CSVNormalizer`.

**Other**: Added more documentation and minor performance improvements.
-----BEGIN SSH SIGNATURE-----
U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAg4OaSdijsW6raSPK3llrsZIEdtk
SQaGaXESF8DcruCNgAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5
AAAAQHjsEcB19j3EnimwfjYFnD3hmLoKFUwTBnTqmhEGt4iWIeQ/8Zqdbf+IRUmZGddywg
C247rhgaem2QQd2qa7Dwc=
-----END SSH SIGNATURE-----
This page took 0.035504 seconds and 3 git commands to generate.