Skip to content

Commit 897629a

Browse files
authored
Merge pull request #312 from C2FO/v4.0.0-rc
V4.0.0
2 parents 84ca8e2 + 9b3bcc7 commit 897629a

File tree

276 files changed

+17663
-5877
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+17663
-5877
lines changed

.eslintrc.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module.exports = {
22
parser: "@typescript-eslint/parser",
33
parserOptions: {
4-
project: "./tsconfig.json"
4+
project: "./tsconfig.build.json"
55
},
66
plugins: ["@typescript-eslint", "prettier"],
77
extends: [
@@ -14,8 +14,9 @@ module.exports = {
1414
],
1515
env: {
1616
node: true,
17-
mocha: true,
17+
jest: true,
1818
},
19+
ignorePatterns: ["**/build", "**/node_modules"],
1920
settings:{
2021
"import/extensions": [
2122
".ts"
@@ -51,6 +52,8 @@ module.exports = {
5152
4,
5253
{ "SwitchCase": 1 }
5354
],
55+
"import/prefer-default-export": 0,
56+
"import/no-default-export": ["error"],
5457
"no-restricted-syntax": ["error", "ForInStatement", "LabeledStatement", "WithStatement"],
5558
"object-curly-spacing": ["error", "always"],
5659
"no-underscore-dangle": 0,
@@ -65,7 +68,7 @@ module.exports = {
6568
overrides: [
6669
{
6770
"files": [
68-
"*.test.ts"
71+
"*.spec.ts"
6972
],
7073
"rules": {
7174
"@typescript-eslint/explicit-function-return-type": "off",
@@ -74,7 +77,8 @@ module.exports = {
7477
},
7578
{
7679
"files": [
77-
"*.js"
80+
"*.js",
81+
"examples/example-runner/bin/run-examples"
7882
],
7983
"rules": {
8084
"@typescript-eslint/explicit-function-return-type": "off",

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ assignees: doug-martin, dustinsmith1024
1010
**Describe the bug**
1111
A clear and concise description of what the bug is.
1212

13+
**Parsing or Formatting?**
14+
15+
- [ ] Formatting
16+
- [ ] Parsing
17+
1318
**To Reproduce**
1419
Steps to reproduce the behavior:
1520
1. Example file contents if applicable

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ assignees: doug-martin, dustinsmith1024
77

88
---
99

10+
**Parsing or Formatting?**
11+
12+
- [ ] Formatting
13+
- [ ] Parsing
14+
1015
**Is your feature request related to a problem? Please describe.**
1116
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1217

.gitignore

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,7 @@ node_modules
55
benchmark/results
66
.nyc_output
77
build
8-
**/tmp
9-
coverage
8+
coverage
9+
**/*.tmp.csv
10+
**/*.tsbuildinfo
11+
lerna-debug.log

.mocharc.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

.nycrc

Lines changed: 0 additions & 24 deletions
This file was deleted.

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ node_js:
44
- "10"
55
- "8"
66

7+
script:
8+
- npm run bootstrap
9+
- npm run build
10+
- npm run test
11+
712
after_success: npm run coverage

History.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
# v4.0.0
2+
3+
* Migrated from mocha to jest
4+
* Moved to `lerna`.
5+
* Split `parse` and `format` packages
6+
* Added running examples and checking output as part of the tests
7+
* Updated docs for new directory layout
8+
* Added typescript examples
9+
* Added generics type support to format and parse streams
10+
* [ADDED] Docs around using `strictColumnHandling` to emit errors when there are more columns than headers [#195]
11+
112
# v3.7.0
213

314
* [ADDED] Ability to Transform Header [#287](https://github.com/C2FO/fast-csv/issues/287)

README.md

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -7,54 +7,33 @@
77

88
Fast-csv is library for parsing and formatting csvs or any other delimited value file in node.
99

10-
## Installation
10+
## Packages
1111

12-
`npm install -S fast-csv`
12+
There are three packages published from this repo.
1313

14-
## Usage
14+
### [`fast-csv`](./packages/fast-csv)
1515

16-
To use `fast-csv` in `javascript` you can require the module/
16+
Exposes both formatting and parsing methods in a single package, use this if you need to parse and format files.
1717

18-
```js
19-
const csv = require('fast-csv');
20-
```
18+
* [Docs](./packages/fast-csv/README.md)
19+
* [JavaScript Examples](./examples/fast-csv-js/README.md)
20+
* [TypeScript Examples](./examples/fast-csv-ts/README.md)
2121

22-
To import with typescript
22+
###[`@fast-csv/parse`](./packages/parse)
2323

24-
```typescript
25-
import * as csv from 'fast-csv';
26-
```
24+
Parsing package, use this if you only need to parse files.
2725

28-
## Documentation
26+
* [Docs](./packages/parse/README.md)
27+
* [JavaScript Examples](./examples/parsing-js/README.md)
28+
* [TypeScript Examples](./examples/parsing-ts/README.md)
2929

30-
* [Parsing Docs](./docs/parsing.md)
31-
* [Formatting Docs](./docs/formatting.md)
30+
### [`@fast-csv/format`](./packages/format)
3231

33-
### Quick Examples
34-
35-
**parsing**
36-
37-
To read a csv with headers create a read stream and pipe it to parser.
38-
39-
```javascript
40-
fs.createReadStream('path/to/my.csv')
41-
.pipe(csv.parse({ headers: true }))
42-
.on('data', row => console.log(row))
43-
```
44-
45-
For more in depth parsing examples and docs check out the [parsing docs](./docs/parsing.md)
46-
47-
**formatting**
48-
49-
To format a csv you can write rows to a formatter.
50-
51-
```javascript
52-
someStream
53-
.pipe(csv.format({ headers: true })
54-
.pipe(process.stdout);
55-
```
56-
57-
For more in depth formatting examples and docs check out the [formatting docs](./docs/formatting.md)
32+
Formatting package, use this if you only need to format files.
33+
34+
* [Docs](./packages/format/README.md)
35+
* [JavaScript Examples](./examples/formatting-js/README.md)
36+
* [TypeScript Examples](./examples/formatting-ts/README.md)
5837

5938
### Migrating from older versions
6039

@@ -70,3 +49,4 @@ MIT <https://github.com/C2FO/fast-csv/raw/master/LICENSE>
7049
* Twitter: [http://twitter.com/c2fo](http://twitter.com/c2fo) - 877.465.4045
7150

7251

52+
File renamed without changes.

0 commit comments

Comments
 (0)