JSPM

yoga-wasm

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 105
  • Score
    100M100P100Q61290F
  • License MIT

The Yoga layout engine, but in WebAssembly

Package Exports

  • yoga-wasm

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (yoga-wasm) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

yoga-wasm

yoga-wasm is a build of Facebook's Yoga Flexbox layout engine, for JavaScript and WebAssembly.

It is a drop in replacement for the yoga-layout NPM package.

Installation

# npm
npm install --save yoga-wasm

# yarn
yarn add yoga-wasm

Usage

You should be able to use yoga-wasm in the same way you would normally use yoga-layout:

import * as yoga from "yoga-wasm";

const node = yoga.Node.create();

node.setMaxWidth(100);

node.computeLayout(100, 100, yoga.DIRECTION_LTR);

Prior Art

yoga-dom is another attempt to port Yoga to JS with WebAssembly. I leaned heavily on viankakrisna's embind bindings when porting the latest version of Yoga's bindings from nbind to embind.

Contributing

Open a PR or file an issue!