🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

@bcherny/yoga-wasm-web

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bcherny/yoga-wasm-web

[Yoga](https://github.com/facebook/yoga) but in WebAssembly.

latest
Source
npmnpm
Version
0.3.5
Version published
Maintainers
0
Created
Source

yoga-wasm-web

Yoga but in WebAssembly.

Usage

Install with your package manager:

npm i @bcherny/yoga-wasm-web

WASM

To use the WASM build (take Node.js as an example):

import fs from "fs";
import initYoga, { ALIGN_CENTER } from "@bcherny/yoga-wasm-web";

const Yoga = await initYoga(
  fs.readFileSync("./node_modules/@bcherny/yoga-wasm-web/dist/yoga.wasm")
);

const node = Yoga.Node.create();
node.setAlignContent(ALIGN_CENTER);

You can use other ways to provide the WASM binary too.

Contribution

To develop this project locally, you need to clone the repo and fetch the yoga submodule first. Also, emcc is required to build this project too.

After that, install npm dependencies:

pnpm i

And run the build script:

pnpm build

And run the tests:

pnpm test

Acknowledgements

This project was started as opinionated fork from pinqy520/yoga-layout-wasm

FAQs

Package last updated on 26 Dec 2024

Did you know?

Socket

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.

Install

Related posts