Gathering detailed insights and metrics for @codepunkt/wasm-layout-text
Gathering detailed insights and metrics for @codepunkt/wasm-layout-text
Gathering detailed insights and metrics for @codepunkt/wasm-layout-text
Gathering detailed insights and metrics for @codepunkt/wasm-layout-text
npm install @codepunkt/wasm-layout-text
Typescript
Module System
Node Version
NPM Version
Rust (62.94%)
JavaScript (33.46%)
Makefile (3.6%)
Total Downloads
9,673
Last Day
1
Last Week
12
Last Month
34
Last Year
671
MIT License
2 Stars
6 Commits
2 Watchers
1 Branches
1 Contributors
Updated on Oct 03, 2023
Minified
Minified + Gzipped
Latest Version
3.0.0
Package Id
@codepunkt/wasm-layout-text@3.0.0
Unpacked Size
123.85 kB
Size
44.68 kB
File Count
6
NPM Version
6.14.6
Node Version
12.18.3
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
500%
12
Compared to previous week
Last Month
-40.4%
34
Compared to previous month
Last Year
-71.3%
671
Compared to previous year
No dependencies detected.
This package layouts text and returns the result as an UInt8Array
of pixels. It supports:
The package provides a render
function that returns an UInt8Array
of pixels:
1const { readFileSync } = requir("fs");
2const { join } = require("path");
3const wlt = require("@codepunkt/wasm-layout-text");
4
5const font = readFileSync(join(__dirname, "myfont.ttf"));
6
7const buffer = wlt.render(
8 // text, size, color, ttf font buffer
9 new wlt.Text("Hello world", 64, new wlt.RgbColor(91, 214, 123), font),
10 // image dimension
11 new wlt.Dimension(1200, 630),
12 // text bounds
13 new wlt.Dimensions(1100, 530),
14 // text position
15 new wlt.Position(50, 50),
16 // text alignment
17 new wlt.Alignment(wlt.HorizontalAlign.Left, wlt.VerticalAlign.Top)
18);
You can then use Jimp or other image processing libraries to
Contributions are welcome! A JavaScript usage example with Jimp is available in the example
directory.
There are a few make
tasks, most notably:
make build
: will build rust code from ./src
to JavaScript code in ./pkg
(using wasm-pack)make node
: executes the example
code with Node.js and uses the local JavaScript package from .pkg
to render all alignment permutations (expects the ./pkg
folder to exist)No vulnerabilities found.
Reason
license file detected
Details
Reason
binaries present in source code
Details
Reason
5 existing vulnerabilities detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More