wpilog-parser 2.3.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 CHANGED
@@ -12,15 +12,19 @@ npm install wpilog-parser
12
12
 
13
13
  ```ts
14
14
  import { readFile } from 'node:fs/promises';
15
- import { readRecords, decodeRecords } from 'wpilog-parser';
15
+ import { parseDataLog } from 'wpilog-parser';
16
16
 
17
17
  const bytes = await readFile('./example.wpilog');
18
18
 
19
- for (const record of decodeRecords(readRecords(bytes))) {
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
+
24
28
  ## CLI
25
29
 
26
30
  List every entry available in a log before writing an analysis script: