
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
mika-rust-lodash
Advanced tools
这是一个将 Rust 编译为 WebAssembly,为前端提供高性能计算能力的工具库,包含多个实用方法。
// vite在配置入口中引入"vite-plugin-wasm"以及"vite-plugin-top-level-await" plugin,提供wasm格式支持
import wasm from "vite-plugin-wasm";
import topLevelAwait from "vite-plugin-top-level-await";
export default defineConfig({
plugins: [wasm(), topLevelAwait()],
});
// webpack配置中注意,webpack版本为^5.97.0,需要引入"@wasm-tool/wasm-pack-plugin"
const WasmPackPlugin = require("@wasm-tool/wasm-pack-plugin");
const config = {
plugins: [
new WasmPackPlugin({
crateDirectory: path.resolve(__dirname, "."),
}),
],
};
let lib = import("mika-rust-lodash");
lib
.then((wasm) => {
const mod = wasm;
console.log(
// rust内所实现方法通过mod.xxx(...args)进行使用
mod.quick_sort([
4, 5, 6, 7, 2, 3, 5, 6, 8, 23, 4155, 6666, 4, 323123, 5, 9, -4,
])
);
})
.catch(console.error);
# 安装 Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# 安装 wasm-pack
curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
# 安装wasm-bindgen-cli依赖
cargo install wasm-bindgen-cli
# build rust相关方法至wasm文件
cargo build --target=wasm32-unknown-unknown
# 通过wasm-bindgen构建js入口
wasm-bindgen target/wasm32-unknown-unknown/debug/mika-rust-lodash.wasm --out-dir ./pkg
与纯 JavaScript 实现相比,Rust WASM 版本在以下方面表现更优:
FAQs
这是一个将 Rust 编译为 WebAssembly,为前端提供高性能计算能力的工具库,包含 20 个实用方法。
We found that mika-rust-lodash demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.