Add a new npm package dependency to a TypeScript Golem project. Use when the user asks to add a library, package, or dependency.
node:child_process, node:cluster, node:http2, node:worker_threads.fetch, Headers, Request, Response, , , , , , , timers, , /, Streams (, , ), , /, /, /, FormDataBlobFileURLURLSearchParamsconsoleAbortControllerTextEncoderTextDecoderReadableStreamWritableStreamTransformStreamstructuredClonecrypto.randomUUIDcrypto.getRandomValuesEventEventTargetMessageChannelMessagePortIntlnode:buffer, node:crypto (hashes, HMAC, ciphers, key generation, sign/verify, DH, ECDH, X509), node:dgram (UDP), node:dns, node:events, node:fs and node:fs/promises (comprehensive filesystem), node:http/node:https (client and server), node:net (TCP sockets and servers), node:os, node:path, node:perf_hooks, node:process, node:querystring, node:readline, node:sqlite (embedded, requires feature flag), node:stream, node:test, node:timers, node:url, node:util, node:v8, node:vm, node:zlib (gzip, deflate, brotli)Check the wasm-rquickjs README for the up-to-date list.
Install the package
From the project root (where package.json is):
npm install <package-name>
For dev-only dependencies (build tools, type definitions):
npm install --save-dev <package-name>
Build to verify
golem build
Do NOT run npx rollup or npx tsc directly — always use golem build.
If the build or runtime fails
X is not defined): the package depends on a Node.js or browser API not available in the QuickJS runtime. Look for an alternative package.These are already in the project's package.json — do NOT add them again:
@golemcloud/golem-ts-sdk — Golem agent framework, durability, transactions, RPC@golemcloud/golem-ts-typegen (dev) — type metadata generationrollup with plugins (dev) — bundling pipelinetypescript (dev) — TypeScript compilerUse the built-in fetch API — it is available globally.
Use any third party AI/LLM library from npmjs.com, but it has to only depend on the supported runtime APIs.