wpilog-parser 2.2.0 → 2.4.0
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/README.md +25 -7
- package/dist/catalog-BT6geQr0.mjs +1343 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +81 -0
- package/dist/index.d.mts +83 -69
- package/dist/index.mjs +2 -1070
- package/package.json +24 -17
- package/skills/analyze-wpilog/SKILL.md +15 -26
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ Read [WPILib data log (`.wpilog`)](https://docs.wpilib.org/en/stable/docs/softwa
|
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
7
|
-
```
|
|
7
|
+
```sh
|
|
8
8
|
npm install wpilog-parser
|
|
9
9
|
```
|
|
10
10
|
|
|
@@ -12,32 +12,50 @@ npm install wpilog-parser
|
|
|
12
12
|
|
|
13
13
|
```ts
|
|
14
14
|
import { readFile } from 'node:fs/promises';
|
|
15
|
-
import {
|
|
15
|
+
import { parseDataLog } from 'wpilog-parser';
|
|
16
16
|
|
|
17
17
|
const bytes = await readFile('./example.wpilog');
|
|
18
18
|
|
|
19
|
-
for (const record of
|
|
19
|
+
for (const record of parseDataLog(bytes)) {
|
|
20
20
|
console.log(record);
|
|
21
21
|
}
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
`parseDataLog()` is the preferred API for fully decoded records. It reads and decodes the file in one pass, avoiding the intermediate record allocations made by composing `readRecords()` and `decodeRecords()`.
|
|
25
|
+
|
|
26
|
+
Use `readRecords()` and `decodeRecords()` separately when you need access to raw records or want to transform the record stream before decoding it. Both approaches produce the same decoded records.
|
|
27
|
+
|
|
28
|
+
## CLI
|
|
29
|
+
|
|
30
|
+
List every entry available in a log before writing an analysis script:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
npx wpilog-parser catalog ./example.wpilog
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The default output is [TOON](https://toonformat.dev). JSON, JSONL/NDJSON, and CSV are also supported:
|
|
37
|
+
|
|
38
|
+
```sh
|
|
39
|
+
npx wpilog-parser catalog ./example.wpilog --json
|
|
40
|
+
```
|
|
41
|
+
|
|
24
42
|
## Agent skill
|
|
25
43
|
|
|
26
|
-
This package ships an [Agent Skill](https://agentskills.io) at `skills/wpilog
|
|
44
|
+
This package ships an [Agent Skill](https://agentskills.io) at `skills/analyze-wpilog/SKILL.md` that teaches AI coding agents how to use the library. Install it into your project with either:
|
|
27
45
|
|
|
28
|
-
```
|
|
46
|
+
```sh
|
|
29
47
|
# https://skills.sh/
|
|
30
48
|
npx skills add jonahsnider/wpilog-parser
|
|
31
49
|
```
|
|
32
50
|
|
|
33
|
-
```
|
|
51
|
+
```sh
|
|
34
52
|
# https://github.com/antfu/skills-npm
|
|
35
53
|
npx skills-npm
|
|
36
54
|
```
|
|
37
55
|
|
|
38
56
|
## Development
|
|
39
57
|
|
|
40
|
-
```
|
|
58
|
+
```sh
|
|
41
59
|
vp install
|
|
42
60
|
vp test
|
|
43
61
|
vp pack
|