@vp-tw/ptt-link-switcher 0.2.0 → 0.2.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 +10 -6
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,10 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
Parse and convert PTT article links across supported readers—entirely offline.
|
|
4
4
|
|
|
5
|
+
Install with `npm install @vp-tw/ptt-link-switcher`. The package exposes an ESM
|
|
6
|
+
entry point and TypeScript declarations. Release checks exercise Node.js 24 and
|
|
7
|
+
TypeScript 6 with NodeNext module resolution.
|
|
8
|
+
|
|
5
9
|
```ts
|
|
6
10
|
import { generateProviderLinks, parsePttInput } from "@vp-tw/ptt-link-switcher";
|
|
7
11
|
|
|
8
|
-
const result = parsePttInput("#
|
|
12
|
+
const result = parsePttInput("#1fcP3ZRj", { board: "Gossiping" });
|
|
9
13
|
|
|
10
14
|
if (result.ok) {
|
|
11
15
|
const links = generateProviderLinks(result.article);
|
|
@@ -20,27 +24,27 @@ if (result.ok) {
|
|
|
20
24
|
{
|
|
21
25
|
"id": "official",
|
|
22
26
|
"label": "PTT 官方",
|
|
23
|
-
"url": "https://www.ptt.cc/bbs/
|
|
27
|
+
"url": "https://www.ptt.cc/bbs/Gossiping/M.1771671779.A.6ED.html"
|
|
24
28
|
},
|
|
25
29
|
{
|
|
26
30
|
"id": "beptt",
|
|
27
31
|
"label": "BePTT",
|
|
28
|
-
"url": "https://bbs.beptt.tw/
|
|
32
|
+
"url": "https://bbs.beptt.tw/Gossiping/M.1771671779.A.6ED"
|
|
29
33
|
},
|
|
30
34
|
{
|
|
31
35
|
"id": "pttweb",
|
|
32
36
|
"label": "PTTweb",
|
|
33
|
-
"url": "https://www.pttweb.cc/bbs/
|
|
37
|
+
"url": "https://www.pttweb.cc/bbs/Gossiping/M.1771671779.A.6ED"
|
|
34
38
|
},
|
|
35
39
|
{
|
|
36
40
|
"id": "moptt",
|
|
37
41
|
"label": "MoPTT",
|
|
38
|
-
"url": "https://moptt.tw/p/
|
|
42
|
+
"url": "https://moptt.tw/p/Gossiping.M.1771671779.A.6ED"
|
|
39
43
|
},
|
|
40
44
|
{
|
|
41
45
|
"id": "nextptt",
|
|
42
46
|
"label": "NextPTT",
|
|
43
|
-
"url": "https://nextptt.app/boards/
|
|
47
|
+
"url": "https://nextptt.app/boards/Gossiping/post/M.1771671779.A.6ED"
|
|
44
48
|
}
|
|
45
49
|
]
|
|
46
50
|
```
|