{"_id":"@bitfrost/yoga-wasm-web","name":"@bitfrost/yoga-wasm-web","dist-tags":{"latest":"0.3.3"},"versions":{"0.3.3":{"name":"@bitfrost/yoga-wasm-web","version":"0.3.3","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","bun":"./dist/bun.js","browser":"./dist/browser.js","default":"./dist/node.js"}},"scripts":{"build":"make && rollup -c && cp ./dist/yoga.wasm ./dist/yoga.bun","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://github.com/bitfrost/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"},"packageManager":"pnpm@9.12.0+sha512.4abf725084d7bcbafbd728bfc7bee61f2f791f977fd87542b3579dcb23504d170d46337945e4c66485cd12d588a0c0e570ed9c477e7ccdd8507cf05f3f92eaca","_id":"@bitfrost/yoga-wasm-web@0.3.3","gitHead":"71d4dab0e8af3d33fe37195a135df9647c88840f","description":"[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js.","bugs":{"url":"https://github.com/bitfrost/yoga-wasm-web/issues"},"homepage":"https://github.com/bitfrost/yoga-wasm-web#readme","_nodeVersion":"18.20.4","_npmVersion":"10.7.0","dist":{"integrity":"sha512-WjNRKXmI7ZvjYEClvn0C4FVZS6HZq9zmaKGnopb1zUsg05wzErIFwTmo6JOlYfkd7LV4TjyqyCO2AMyrW/11gw==","shasum":"e770027feed3d517b9a9d1c134b5494588d51e85","tarball":"https://registry.npmjs.org/@bitfrost/yoga-wasm-web/-/yoga-wasm-web-0.3.3.tgz","fileCount":20,"unpackedSize":389047,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGa/SCFJkJA8kkaYAoMFWKprdlDVjvPZnr9nM/t98FR2AiADpa0PZ2xDJhhisfyGijxNk7VvvgQwhhThAwRxjgXCoQ=="}]},"_npmUser":{"name":"bitfrost","email":"bitfrost@gmail.com"},"directories":{},"maintainers":[{"name":"bitfrost","email":"bitfrost@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/yoga-wasm-web_0.3.3_1728001935369_0.36810802469053505"},"_hasShrinkwrap":false}},"time":{"created":"2024-10-04T00:32:15.261Z","0.3.3":"2024-10-04T00:32:15.548Z","modified":"2024-10-04T00:32:15.838Z"},"maintainers":[{"name":"bitfrost","email":"bitfrost@gmail.com"}],"description":"[Yoga](https://github.com/facebook/yoga) but in WebAssembly and ASM.js.","homepage":"https://github.com/bitfrost/yoga-wasm-web#readme","repository":{"type":"git","url":"git://github.com/bitfrost/yoga-wasm-web.git"},"bugs":{"url":"https://github.com/bitfrost/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"}