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
71.7
Supply Chain
82.1
Quality
75.3
Maintenance
100
Vulnerability
100
License
Rust (62.94%)
JavaScript (33.46%)
Makefile (3.6%)
Total Downloads
9,394
Last Day
1
Last Week
3
Last Month
35
Last Year
657
2 Stars
6 Commits
3 Watching
1 Branches
1 Contributors
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
-50%
3
Compared to previous week
Last month
29.6%
35
Compared to previous month
Last year
-81.7%
657
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
4 existing vulnerabilities detected
Details
Reason
Found 0/6 approved changesets -- score normalized to 0
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
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-01-13
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