@reventlessdev/rescript-fast-csv 1.2.0-alpha.11 → 1.2.0-alpha.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -1
- package/README.md +34 -12
- package/package.json +12 -14
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# 1.2.0-alpha.
|
|
6
|
+
# 1.2.0-alpha.13 (2026-07-16)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @reventlessdev/rescript-fast-csv
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# 1.2.0-alpha.12 (2026-07-11)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @reventlessdev/rescript-fast-csv
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# 1.2.0-alpha.11 (2026-06-27)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @reventlessdev/rescript-fast-csv
|
|
9
25
|
|
package/README.md
CHANGED
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
[](https://www.npmjs.com/package/@reventlessdev/rescript-fast-csv)
|
|
2
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
3
|
+
[](https://docs.reventless.dev)
|
|
4
4
|
|
|
5
|
-
#
|
|
5
|
+
# @reventlessdev/rescript-fast-csv
|
|
6
|
+
|
|
7
|
+
> ⚠️ **Alpha.** APIs and on-disk formats can change without notice between releases.
|
|
8
|
+
> Pin exact versions and expect breaking changes.
|
|
6
9
|
|
|
7
10
|
ReScript bindings for [fast-csv](https://github.com/C2FO/fast-csv), a fast and flexible CSV parsing library for Node.js.
|
|
8
11
|
|
|
9
|
-
##
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
12
|
+
## Install
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm add @reventlessdev/rescript-fast-csv
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Add it to your `rescript.json` dependencies:
|
|
19
|
+
|
|
20
|
+
```json
|
|
21
|
+
{
|
|
22
|
+
"dependencies": ["@reventlessdev/rescript-fast-csv"]
|
|
23
|
+
}
|
|
24
|
+
```
|
|
13
25
|
|
|
14
26
|
## Core API
|
|
15
27
|
|
|
@@ -54,7 +66,7 @@ Configure the CSV parser behavior using the `Options.t` type:
|
|
|
54
66
|
| `renameHeaders` | `bool` | `false` | Allow headers to be renamed |
|
|
55
67
|
| `ignoreEmpty` | `bool` | `false` | Skip empty rows |
|
|
56
68
|
| `comment` | `string` | `null` | Character that starts comment lines (skipped) |
|
|
57
|
-
| `
|
|
69
|
+
| `discardUnmappedfolumns` | `bool` | `false` | Discard columns not in headers |
|
|
58
70
|
| `strictColumnHandling` | `bool` | `false` | Throw error if row column count differs from headers |
|
|
59
71
|
| `trim` | `bool` | `false` | Trim whitespace from both ends of fields |
|
|
60
72
|
| `rtrim` | `bool` | `false` | Trim whitespace from right end of fields |
|
|
@@ -171,8 +183,8 @@ FastCSV.parseFile(
|
|
|
171
183
|
->FastCSV.validate((row, callback) => {
|
|
172
184
|
// Check if required fields exist
|
|
173
185
|
switch (Dict.get(row, "name"), Dict.get(row, "email"), Dict.get(row, "age")) {
|
|
174
|
-
| (Some(_), Some(_), Some(_)) => callback->
|
|
175
|
-
| _ => callback->
|
|
186
|
+
| (Some(_), Some(_), Some(_)) => callback->FastCSV_Helpers.toValid
|
|
187
|
+
| _ => callback->FastCSV_Helpers.toInvalid("Missing required fields (name, email, age)")
|
|
176
188
|
}
|
|
177
189
|
})
|
|
178
190
|
->FastCSV.transform((row, callback) => {
|
|
@@ -185,7 +197,7 @@ FastCSV.parseFile(
|
|
|
185
197
|
Dict.set(row, "email", String.toLowerCase(email))
|
|
186
198
|
Dict.set(row, "name", String.trim(name))
|
|
187
199
|
|
|
188
|
-
callback->
|
|
200
|
+
callback->FastCSV_Helpers.toValidTransformation(row)
|
|
189
201
|
})
|
|
190
202
|
->FastCSV.onData(row => {
|
|
191
203
|
// Process each valid row
|
|
@@ -292,3 +304,13 @@ parseFile(~path="data.csv")
|
|
|
292
304
|
- `toError(callback, reason)` - Mark validation as error
|
|
293
305
|
- `toValidTransformation(callback, row)` - Complete transformation successfully
|
|
294
306
|
- `toErrorTransformation(callback, reason)` - Mark transformation as failed
|
|
307
|
+
|
|
308
|
+
## Links
|
|
309
|
+
|
|
310
|
+
- 📚 Documentation — [docs.reventless.dev](https://docs.reventless.dev)
|
|
311
|
+
- 📦 Repository — [ReventlessDev/reventless-core](https://github.com/ReventlessDev/reventless-core)
|
|
312
|
+
- 📋 [Changelog](./CHANGELOG.md)
|
|
313
|
+
|
|
314
|
+
## License
|
|
315
|
+
|
|
316
|
+
[Apache-2.0](https://opensource.org/licenses/Apache-2.0)
|
package/package.json
CHANGED
|
@@ -1,24 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reventlessdev/rescript-fast-csv",
|
|
3
|
-
"version": "1.2.0-alpha.
|
|
3
|
+
"version": "1.2.0-alpha.13",
|
|
4
4
|
"description": "ReScript bindings for fast-csv",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"build": "rescript build",
|
|
8
|
-
"start": "rescript watch",
|
|
9
|
-
"clean": "rescript clean",
|
|
10
|
-
"test": "echo \"There are no tests for rescript-fast-csv.\"",
|
|
11
|
-
"postpublish": "git checkout package.json & echo 'Please ensure the CHANGELOG is up to date!'"
|
|
12
|
-
},
|
|
13
6
|
"dependencies": {
|
|
14
|
-
"
|
|
15
|
-
"
|
|
7
|
+
"fast-csv": "^5.0.5",
|
|
8
|
+
"@reventlessdev/rescript-node-streams": "1.1.0-alpha.12"
|
|
16
9
|
},
|
|
17
10
|
"devDependencies": {
|
|
18
|
-
"rescript": "
|
|
11
|
+
"rescript": "12.3.0"
|
|
19
12
|
},
|
|
20
13
|
"peerDependencies": {
|
|
21
|
-
"rescript": "
|
|
14
|
+
"rescript": "12.3.0"
|
|
22
15
|
},
|
|
23
16
|
"publishConfig": {
|
|
24
17
|
"registry": "https://registry.npmjs.org"
|
|
@@ -28,5 +21,10 @@
|
|
|
28
21
|
"url": "git+https://github.com/ReventlessDev/reventless-core.git",
|
|
29
22
|
"directory": "rescript/rescript-fast-csv"
|
|
30
23
|
},
|
|
31
|
-
"
|
|
32
|
-
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "rescript build",
|
|
26
|
+
"start": "rescript watch",
|
|
27
|
+
"clean": "rescript clean",
|
|
28
|
+
"test": "echo \"There are no tests for rescript-fast-csv.\""
|
|
29
|
+
}
|
|
30
|
+
}
|