Skip to content

Commit

Permalink
Prep for release
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmurphy committed Jun 13, 2021
1 parent de68f0b commit 5925048
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 3 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [5.0.0] - 2021-06-12

### Added
- The `quaff` file processor is now available at `parseFile`. This makes it possible to tap into all of `quaff`'s processors to load a single file. The (now) named `parse` export works the same as before and uses `parseFile` behind the scenes.
- It is now possible to pass in JavaScript files using the `.cjs` and `.mjs` extensions.
- The `quaff` individual file processor is now available at `loadFile`. This makes it possible to tap into all of `quaff`'s processors to load a single file. The newly named `load` export works the same as before and uses `loadFile` behind the scenes.
- It is now possible to include JavaScript files using the `.cjs` and `.mjs` extensions.

### Changed
- `quaff` is now a [pure ESM package](https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c). It can no longer be `require()`'d from CommonJS. If this functionality is still needed please continue to use `quaff@^4`. It is also possible to [dynamically import ESM in CommonJS](https://nodejs.org/api/esm.html#esm_import_expressions) (`await import('quaff')`) if that is compatible with your use case.
- `quaff` no longer has a default export and now uses two named exports - `parse` and `parseFile`.
- `quaff` no longer has a default export and now uses two named exports - `load` and `loadFile`.

## [4.2.0] - 2020-07-16

Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,30 @@ And the results...
}
```

As of `5.0.0` it's now possible to load a single file at a time, enabling more custom approaches in case `load` doesn't work exactly the way you'd like.

```js
import { loadFile } from 'quaff';

const data = await loadFile('./data/mammals/bears.csv');
console.log(data);
```

And the results...

```json
[
{
"name": "Steve",
"type": "Polar bear"
},
{
"name": "Angelica",
"type": "Sun bear"
}
]
```

## Advanced Usage with JavaScript files

One of the biggest features added in `quaff` 4.0 is the ability to load JavaScript files. But how exactly does that work?
Expand Down

0 comments on commit 5925048

Please sign in to comment.