@takumi-rs/core 0.11.1 → 0.11.3
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 +1 -32
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -1,34 +1,3 @@
|
|
|
1
1
|
# @takumi-rs/core
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
```ts
|
|
6
|
-
import { Renderer, OutputFormat } from "@takumi-rs/core";
|
|
7
|
-
import { container, image } from "@takumi-rs/helpers";
|
|
8
|
-
import { writeFile } from "fs/promises";
|
|
9
|
-
|
|
10
|
-
const render = new Renderer();
|
|
11
|
-
|
|
12
|
-
const logoUrl = "https://yeecord.com/img/logo.png";
|
|
13
|
-
const logo = await fetch("https://yeecord.com/img/logo.png").then((r) =>
|
|
14
|
-
r.arrayBuffer()
|
|
15
|
-
);
|
|
16
|
-
|
|
17
|
-
const node = container({
|
|
18
|
-
children: [
|
|
19
|
-
image(logoUrl, {
|
|
20
|
-
width: 128,
|
|
21
|
-
height: 128,
|
|
22
|
-
}),
|
|
23
|
-
],
|
|
24
|
-
background_color: 0xffffff,
|
|
25
|
-
width: percentage(100),
|
|
26
|
-
height: percentage(100),
|
|
27
|
-
});
|
|
28
|
-
|
|
29
|
-
const buffer = await render.renderAsync(node, {
|
|
30
|
-
width: 1200,
|
|
31
|
-
height: 630,
|
|
32
|
-
format: OutputFormat.WebP,
|
|
33
|
-
});
|
|
34
|
-
```
|
|
3
|
+
For detailed documentation, please refer to the [Node.js Integration section](https://takumi.kane.tw/docs/platforms/node) in our official documentation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takumi-rs/core",
|
|
3
|
-
"version": "0.11.
|
|
3
|
+
"version": "0.11.3",
|
|
4
4
|
"author": {
|
|
5
5
|
"email": "me@kane.tw",
|
|
6
6
|
"name": "Kane Wang",
|
|
@@ -41,10 +41,10 @@
|
|
|
41
41
|
"type": "commonjs",
|
|
42
42
|
"types": "index.d.ts",
|
|
43
43
|
"optionalDependencies": {
|
|
44
|
-
"@takumi-rs/core-darwin-arm64": "0.11.
|
|
45
|
-
"@takumi-rs/core-linux-arm64-gnu": "0.11.
|
|
46
|
-
"@takumi-rs/core-linux-arm64-musl": "0.11.
|
|
47
|
-
"@takumi-rs/core-linux-x64-gnu": "0.11.
|
|
48
|
-
"@takumi-rs/core-linux-x64-musl": "0.11.
|
|
44
|
+
"@takumi-rs/core-darwin-arm64": "0.11.3",
|
|
45
|
+
"@takumi-rs/core-linux-arm64-gnu": "0.11.3",
|
|
46
|
+
"@takumi-rs/core-linux-arm64-musl": "0.11.3",
|
|
47
|
+
"@takumi-rs/core-linux-x64-gnu": "0.11.3",
|
|
48
|
+
"@takumi-rs/core-linux-x64-musl": "0.11.3"
|
|
49
49
|
}
|
|
50
50
|
}
|