Socket
Socket
Sign inDemoInstall

yoga-wasm-web

Package Overview
Dependencies
0
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    yoga-wasm-web


Version published
Weekly downloads
459K
decreased by-4.01%
Maintainers
1
Install size
283 kB
Created
Weekly downloads
 

Readme

Source

yoga-wasm-web

Yoga but in WebAssembly and ASM.js.

Usage

Install with your package manager:

pnpm i yoga-wasm-web
npm i yoga-wasm-web
yarn add yoga-wasm-web

ASM.js

To use the ASM.js build:

import initYoga, { ALIGN_CENTER } from 'yoga-wasm-web/asm'

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

WASM

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

import fs from 'fs'
import initYoga, { ALIGN_CENTER } from 'yoga-wasm-web'

const Yoga = await initYoga(
  fs.readFileSync('./node_modules/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

Last updated on 14 Mar 2023

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc