Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@hfour/imager-wasm
Advanced tools
This a simple package to compile selected functions from the image-rs rust package to wasm, and make them available to nodejs. It's configured to support at least GIF, PNG and JPEG (but this may vary depending on our needs).
We don't wrap the whole of image-rs
because the .wasm
file will be too big, and then there's no nodejs
build system that could only take parts of that .wasm file. The rust linker though will only include the used
functions in the .wasm
file.
rustup target add wasm32-unknown-unknown
cargo install wasm-pack
~/.cargo/bin/wasm-pack build --release -t nodejs
fs = require('fs');
img1 = fs.readFileSync('problem.jpg');
m = require('./pkg/imager_wasm');
img2 = m.thumbnail(img1, 800, 800);
fs.writeFileSync('solution.jpg', img2);
This repo has travis configured to publish the build node package on npmjs. When a commit on the master branch is
tagged, travis will try to push the package to npmjs. The version of the node package is copied from Cargo.toml
, so
it's up to you make sure the version is updated accordingly. The tag name is not used, but should follow the version in
Cargo.toml
(and so the node package version). For example, the 0.1.0 version should be tagged as v0.1.0
.
FAQs
selected image-rs function into wasm for nodejs
The npm package @hfour/imager-wasm receives a total of 0 weekly downloads. As such, @hfour/imager-wasm popularity was classified as not popular.
We found that @hfour/imager-wasm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.