@qcy2012/api-wasm-sdk 1.0.0 → 1.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.
Files changed (2) hide show
  1. package/package.json +11 -4
  2. package/test/test1.js +18 -0
package/package.json CHANGED
@@ -1,12 +1,19 @@
1
1
  {
2
2
  "name": "@qcy2012/api-wasm-sdk",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "main": "index.js",
5
5
  "scripts": {
6
6
  "test": "echo \"Error: no test specified\" && exit 1"
7
7
  },
8
- "keywords": ["wasm", "api", "sdk"],
8
+ "keywords": [
9
+ "wasm",
10
+ "api",
11
+ "sdk"
12
+ ],
9
13
  "author": "qcy2012",
10
14
  "license": "ISC",
11
- "description": "An Open Source SDK for interacting with WebAssembly APIs."
12
- }
15
+ "description": "An Open Source SDK for interacting with WebAssembly APIs.",
16
+ "dependencies": {
17
+ "@qcy2012/api-wasm-sdk": "^1.0.0"
18
+ }
19
+ }
package/test/test1.js ADDED
@@ -0,0 +1,18 @@
1
+ const QcyAPI = require('@qcy2012/api-wasm-sdk');
2
+
3
+ // 替换成你控制台里生成的真实 Key
4
+ const api = new QcyAPI('sk_live_YourKeyHere');
5
+
6
+ async function test() {
7
+ try {
8
+ const hashResult = await api.hash('Hello SDK');
9
+ console.log('Hash 结果:', hashResult);
10
+
11
+ const qrResult = await api.qrcode('https://api.qcyblog.dpdns.org');
12
+ console.log('二维码 SVG 长度:', qrResult.svg.length);
13
+ } catch (err) {
14
+ console.error('调用失败:', err.message);
15
+ }
16
+ }
17
+
18
+ test();