skiz-parser 5.0.0 → 5.0.1
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 +6 -14
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# skiz-parser
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Parse a .skiz file exported from Ski Tracks
|
|
4
4
|
|
|
5
5
|
## Install
|
|
6
6
|
|
|
@@ -11,10 +11,10 @@ $ npm install skiz-parser
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import {
|
|
14
|
+
import { readFile } from 'node:fs/promises';
|
|
15
15
|
import { parseSkizFile } from 'skiz-parser';
|
|
16
16
|
|
|
17
|
-
const contents = await
|
|
17
|
+
const contents = await readFile('./example.skiz');
|
|
18
18
|
const result = await parseSkizFile(contents);
|
|
19
19
|
|
|
20
20
|
console.log(result);
|
|
@@ -23,20 +23,12 @@ console.log(result);
|
|
|
23
23
|
|
|
24
24
|
## API
|
|
25
25
|
|
|
26
|
-
### parseSkizFile(contents
|
|
26
|
+
### parseSkizFile(contents)
|
|
27
27
|
|
|
28
|
-
Returns a `Promise<
|
|
29
|
-
|
|
30
|
-
Optionally a callback function may be used instead.
|
|
28
|
+
Returns a `Promise<SkizTrack>` with the parsed .skiz file.
|
|
31
29
|
|
|
32
30
|
#### contents
|
|
33
31
|
|
|
34
|
-
Type: `Buffer`
|
|
32
|
+
Type: `ArrayBuffer | Buffer`
|
|
35
33
|
|
|
36
34
|
Contents of a `.skiz` file.
|
|
37
|
-
|
|
38
|
-
#### callback
|
|
39
|
-
|
|
40
|
-
Type: `Function`
|
|
41
|
-
|
|
42
|
-
Optional callback with error as the first argument and the parsed .skiz file as the second.
|