{"_id":"@anaisbetts/yoga-wasm-web","name":"@anaisbetts/yoga-wasm-web","dist-tags":{"latest":"0.3.3-base64.1"},"versions":{"0.3.3-base64.1":{"name":"@anaisbetts/yoga-wasm-web","version":"0.3.3-base64.1","type":"module","types":"dist/index.d.ts","typesVersions":{"*":{"asm":["dist/asm.d.ts"],"auto":["dist/auto.d.ts"]}},"exports":{"./package.json":"./package.json","./dist/yoga.wasm":"./dist/yoga.wasm",".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./asm":{"types":"./dist/asm.d.ts","default":"./dist/asm.js"},"./auto":{"types":"./dist/auto.d.ts","browser":"./dist/browser.js","default":"./dist/node.js"}},"scripts":{"build":"make && rollup -c","typecheck":"tsc --noEmit","test":"pnpm test:asm && pnpm test:wasm","test:asm":"ASM=true vitest run --dir ./test","test:wasm":"vitest run --dir ./test"},"repository":{"type":"git","url":"git+https://github.com/shuding/yoga-wasm-web.git"},"license":"MIT","devDependencies":{"@rollup/plugin-commonjs":"^24.0.1","@rollup/plugin-node-resolve":"^15.0.1","@swc/core":"^1.3.36","rollup":"^3.17.0","rollup-plugin-swc3":"^0.8.0","typescript":"^4.9.5","vitest":"^0.28.5"},"_id":"@anaisbetts/yoga-wasm-web@0.3.3-base64.1","gitHead":"f87a01ac7ffe086239c99014ed6649603ca390e2","description":"[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js.","bugs":{"url":"https://github.com/shuding/yoga-wasm-web/issues"},"homepage":"https://github.com/shuding/yoga-wasm-web#readme","_nodeVersion":"23.7.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-heQuUoC6clBQTcknsJHiFTWZzk3P77G7tW+hPCThK/tVMUihwgNlPvWJIBJMNvVgQtQ51Mg57i69RKmRav/sfA==","shasum":"fdad1bcdf608fee8a2c1fa1b7f17c635fa6910ab","tarball":"https://registry.npmjs.org/@anaisbetts/yoga-wasm-web/-/yoga-wasm-web-0.3.3-base64.1.tgz","fileCount":20,"unpackedSize":312488,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCICHtmc1eJE6p6stkwJLkkrjFLEZAplXfcIIoPbMCnY1gAiEAw0Z4V43FqLPUyxtefiMLScv0mGf5b8QcHm9piOHDiWo="}]},"_npmUser":{"name":"anaisbetts","email":"anais@anaisbetts.org"},"directories":{},"maintainers":[{"name":"anaisbetts","email":"anais@anaisbetts.org"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/yoga-wasm-web_0.3.3-base64.1_1738940558474_0.7890100232134714"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-07T15:02:38.387Z","0.3.3-base64.1":"2025-02-07T15:02:38.669Z","modified":"2025-02-07T15:02:38.950Z"},"maintainers":[{"name":"anaisbetts","email":"anais@anaisbetts.org"}],"description":"[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js.","homepage":"https://github.com/shuding/yoga-wasm-web#readme","repository":{"type":"git","url":"git+https://github.com/shuding/yoga-wasm-web.git"},"bugs":{"url":"https://github.com/shuding/yoga-wasm-web/issues"},"license":"MIT","readme":"# yoga-wasm-web\n\n[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js. \n\n## Usage\n\nInstall with your package manager:\n\n```sh\npnpm i yoga-wasm-web\nnpm i yoga-wasm-web\nyarn add yoga-wasm-web\n```\n\n### ASM.js\n\nTo use the ASM.js build:\n\n```js\nimport initYoga, { ALIGN_CENTER } from 'yoga-wasm-web/asm'\n\nconst Yoga = initYoga()\nconst node = Yoga.Node.create()\nnode.setAlignContent(ALIGN_CENTER)\n```\n\n### WASM\n\nTo use the WASM build (take Node.js as an example):\n\n```js\nimport fs from 'fs'\nimport initYoga, { ALIGN_CENTER } from 'yoga-wasm-web'\n\nconst Yoga = await initYoga(\n  fs.readFileSync('./node_modules/yoga-wasm-web/dist/yoga.wasm')\n)\n\nconst node = Yoga.Node.create()\nnode.setAlignContent(ALIGN_CENTER)\n```\n\nYou can use other ways to provide the WASM binary too.\n\n\n## Contribution\n\nTo develop this project locally, you need to clone the repo and fetch the yoga submodule first. Also, [emcc](https://emscripten.org/docs/getting_started/downloads.html) is required to build this project too.\n\nAfter that, install npm dependencies:\n\n```sh\npnpm i\n```\n\nAnd run the build script:\n\n```sh\npnpm build\n```\n\nAnd run the tests:\n\n```sh\npnpm test\n```\n\n# Acknowledgements\n\nThis project was started as **opinionated** fork from [pinqy520/yoga-layout-wasm](https://github.com/pinqy520/yoga-layout-wasm)\n","readmeFilename":"README.md"}