miro-export 1.1.0 → 1.1.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 +16 -2
- package/build/cli.js +1 -0
- package/build/index.js +0 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -12,6 +12,17 @@ If accessing a private board, a personal token is required. To get a token, log
|
|
|
12
12
|
|
|
13
13
|
## CLI
|
|
14
14
|
|
|
15
|
+
You can use this tool as a command-line tool.
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- [Node.js >=22](https://nodejs.org/en/download)
|
|
20
|
+
- npm (built-in to Node.js), yarn, or pnpm
|
|
21
|
+
|
|
22
|
+
### Installation
|
|
23
|
+
|
|
24
|
+
The CLI can be ran using [npx](https://docs.npmjs.com/cli/v8/commands/npx) with `npx miro-export [options]` (see options below). Alternatively, it's possible to install the package to the global scope with, for example, `npm i -g miro-export`.
|
|
25
|
+
|
|
15
26
|
### Usage
|
|
16
27
|
|
|
17
28
|
```
|
|
@@ -30,6 +41,9 @@ Options:
|
|
|
30
41
|
# export "Frame 2" to the file "My Frame 2.svg"
|
|
31
42
|
miro-export -t XYZ -b uMoVLkx8gIc= -f "Frame 2" -o "My Frame 2.svg"
|
|
32
43
|
|
|
44
|
+
# using npx
|
|
45
|
+
npx miro-export -t XYZ -b uMoVLkx8gIc= -f "Frame 2" -o "My Frame 2.svg"
|
|
46
|
+
|
|
33
47
|
# export entire board to stdout
|
|
34
48
|
miro-export -t XYZ -b uMoVLkx8gIc=
|
|
35
49
|
|
|
@@ -86,13 +100,13 @@ await using miroBoard = new MiroBoard({
|
|
|
86
100
|
});
|
|
87
101
|
|
|
88
102
|
// get all board objects of type frame and with title "Frame 1"
|
|
89
|
-
const framesWithTitleFrame1 = miroBoard.getBoardObjects(
|
|
103
|
+
const framesWithTitleFrame1 = await miroBoard.getBoardObjects(
|
|
90
104
|
{ type: "frame" }, // required (but empty object is OK too), limited field support
|
|
91
105
|
{ title: "Frame 1" } // optional additional filters
|
|
92
106
|
);
|
|
93
107
|
|
|
94
108
|
// get SVG of the first frame found above
|
|
95
|
-
const svgOfFrame1 = miroBoard.getSvg([framesWithTitleFrame1[0].id]);
|
|
109
|
+
const svgOfFrame1 = await miroBoard.getSvg([framesWithTitleFrame1[0].id]);
|
|
96
110
|
|
|
97
111
|
// if you can't use "await using" for disposal, you can also dispose manually:
|
|
98
112
|
// await miroBoard.dispose()
|
package/build/cli.js
CHANGED
package/build/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "miro-export",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"author": "jolle <npm-contact@jolle.io>",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
},
|
|
49
49
|
"scripts": {
|
|
50
50
|
"lint": "eslint src/*.ts && prettier -c src/*.ts",
|
|
51
|
-
"build": "tsc && echo \"#!/usr/bin/env node\n$(cat ./build/
|
|
51
|
+
"build": "tsc && echo \"#!/usr/bin/env node\n$(cat ./build/cli.js)\" > ./build/cli.js",
|
|
52
52
|
"test": "npm run test:board-object-types && npm run test:api",
|
|
53
53
|
"test:board-object-types": "tsx tests/board-object-types.ts",
|
|
54
54
|
"test:api": "tsx tests/api.test.ts"
|