{"_id":"@aliceoncesaidhallo/cart-luau","name":"@aliceoncesaidhallo/cart-luau","dist-tags":{"latest":"0.1.4"},"versions":{"0.1.4":{"name":"@aliceoncesaidhallo/cart-luau","version":"0.1.4","main":"./dist/src/index.cjs","module":"./dist/src/index.js","types":"./dist/index.d.ts","type":"module","exports":{"types":"./dist/index.d.ts","import":"./dist/src/index.js","require":"./dist/src/index.cjs"},"devDependencies":{"@types/bun":"latest","bun-plugin-dts":"^0.3.0"},"peerDependencies":{"typescript":"^5.0.0"},"dependencies":{"@bjorn3/browser_wasi_shim":"^0.4.0"},"scripts":{"build":"bun run build.ts","prepublishOnly":"bun run build"},"_id":"@aliceoncesaidhallo/cart-luau@0.1.4","gitHead":"c9c598de23cbf039aabbc935c0cb973bee0051cb","description":"To install dependencies:","_nodeVersion":"23.2.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-c8173YZ6rCEH4C1+CRnK7K4xHsdcFDj+YSpxysCB3ImK6wyJ5Fk5b0IbBgC6/2HUKc77QPeIvpbQ3NvnL015gw==","shasum":"9ef4325ae60825e2f5fb616f23eec3b7c5fff165","tarball":"https://registry.npmjs.org/@aliceoncesaidhallo/cart-luau/-/cart-luau-0.1.4.tgz","fileCount":5,"unpackedSize":138751,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCcazo2VOqGH3iCQHD1dDZF1ln+kLArVjbPgBgmZYBm/QIgEqiehuevSLwAaOI6Hj4NM1qIHDln5UJeqYorp6E2jjo="}]},"_npmUser":{"name":"aliceoncesaidhallo","email":"alicejustwantedtosignup@gmail.com"},"directories":{},"maintainers":[{"name":"aliceoncesaidhallo","email":"alicejustwantedtosignup@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/cart-luau_0.1.4_1739814758923_0.7110770773778361"},"_hasShrinkwrap":false}},"time":{"created":"2025-02-17T17:52:38.814Z","0.1.4":"2025-02-17T17:52:39.082Z","modified":"2025-02-17T17:52:39.372Z"},"maintainers":[{"name":"aliceoncesaidhallo","email":"alicejustwantedtosignup@gmail.com"}],"description":"To install dependencies:","readme":"# cart\n\nTo install dependencies:\n\n```bash\nbun install\n```\n\n## Example usage\n\n```ts\nimport type { Inode } from \"@bjorn3/browser_wasi_shim\";\nimport { File } from \"@bjorn3/browser_wasi_shim\";\nimport { Cart, CartOptions, Memory, stdIo } from \"../../packages/cart\";\n\nconst shared_mem = new Memory();\n\nconst fs = new Map<string, Inode>();\n\nconst cart = new Cart(\n  new CartOptions({\n    memory: shared_mem,\n    args: [],\n    env: [],\n    fds: stdIo(\"\", fs),\n  })\n);\n\nasync function run() {\n  await cart.load(/*wasm path*/);\n  const thread = cart.loadThreadFromString(\"fib\", `\nlocal function fib(n)\n  if n == 0 then\n    return 0\n  elseif n == 1 then\n    return 1\n  else\n    return fib(n - 1) + fib(n - 2)\n  end\nend\n\nprint(fib(10))\n  `);\n  if (!thread.valid) {\n    throw new Error(\"Failed to load example\");\n  }\n  await thread.execute();\n}\n\nrun();\n```\n","readmeFilename":"README.md"}