{"_id":"@bedrock-oss/qjs-opt","name":"@bedrock-oss/qjs-opt","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@bedrock-oss/qjs-opt","author":{"name":"Bedrock OSS"},"description":"Static optimizer for QuickJS-bridged expensive API calls using TS type info + JSON whitelist.","keywords":["minecraft","bedrock","addon","script-api","typescript"],"version":"0.1.0","type":"module","private":false,"license":"MIT","exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"}},"publishConfig":{"access":"public"},"types":"dist/index.d.ts","bin":{"qjs-opt":"dist/index.js"},"repository":{"type":"git","url":"git+https://github.com/Bedrock-OSS/qjs-opt.git"},"scripts":{"build":"node scripts/build.mjs","test":"node --loader ts-node/esm --experimental-vm-modules ./node_modules/jest/bin/jest.js --runInBand","prepublish":"npm run build"},"dependencies":{"ts-morph":"^24.0.0"},"devDependencies":{"@types/jest":"^29.5.12","esbuild":"^0.25.0","jest":"^29.7.0","ts-jest":"^29.2.5","ts-node":"^10.9.2","typescript":"^5.6.3"},"engines":{"node":">=18"},"_id":"@bedrock-oss/qjs-opt@0.1.0","gitHead":"62b1aab0c2f6528778c5230b0ec752975c4785aa","bugs":{"url":"https://github.com/Bedrock-OSS/qjs-opt/issues"},"homepage":"https://github.com/Bedrock-OSS/qjs-opt#readme","_nodeVersion":"22.20.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-kYTXF9lmM16HFt5zyHvHgC/aey+Sbi/Y51/UZd4pPVnafwEtq32Io8YqJwI0le+UyLKgDfbpMkHFgPswuLIDzw==","shasum":"5f43b0b4a0a20ea5de9cdba96e189a335d6eeb1f","tarball":"https://registry.npmjs.org/@bedrock-oss/qjs-opt/-/qjs-opt-0.1.0.tgz","fileCount":37,"unpackedSize":13475982,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDsMIxfYTmTljSrBaZbCJeVVtXOyW4Kfy3L+KBTQUwr1QIgG8A3ioWFb2qPXo39c/Am21D4zBJvuJcbCty04erpkrM="}]},"_npmUser":{"name":"stirante","email":"brzozowski.s.piotr@gmail.com"},"directories":{},"maintainers":[{"name":"stirante","email":"brzozowski.s.piotr@gmail.com"},{"name":"jannisx11","email":"jannis4236@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/qjs-opt_0.1.0_1760269618941_0.7806524951012883"},"_hasShrinkwrap":false}},"time":{"created":"2025-10-12T11:46:58.845Z","0.1.0":"2025-10-12T11:46:59.162Z","modified":"2025-10-12T11:46:59.435Z"},"maintainers":[{"name":"stirante","email":"brzozowski.s.piotr@gmail.com"},{"name":"jannisx11","email":"jannis4236@gmail.com"}],"description":"Static optimizer for QuickJS-bridged expensive API calls using TS type info + JSON whitelist.","homepage":"https://github.com/Bedrock-OSS/qjs-opt#readme","keywords":["minecraft","bedrock","addon","script-api","typescript"],"repository":{"type":"git","url":"git+https://github.com/Bedrock-OSS/qjs-opt.git"},"author":{"name":"Bedrock OSS"},"bugs":{"url":"https://github.com/Bedrock-OSS/qjs-opt/issues"},"license":"MIT","readme":"qjs-opt\n=======\n\nStatic optimizer for QuickJS-bridged expensive API calls using TS type info + JSON whitelist.\n\nQuickJS performs native calls for most property or method access on native\nobjects. `qjs-opt` rewrites Minecraft Bedrock addon code so repeated lookups on\n`@minecraft/server` native objects are cached in local variables.\n\nCLI Usage\n---------\n\n```\nnpx @bedrock-oss/qjs-opt [options] <file-or-folder>\n```\n\nKey scenarios:\n\n- Single file with pre-installed types:\n  ```\n  npx @bedrock-oss/qjs-opt src/loop.js\n  ```\n\n- Single file with dependencies to install into a temporary workspace:\n  ```\n  npx @bedrock-oss/qjs-opt --deps @minecraft/server@^2.2.0 src/loop.js\n  ```\n\n- Project directory that already has a `tsconfig.json`:\n  ```\n  npx @bedrock-oss/qjs-opt ./addon\n  ```\n\n- Project directory without a `tsconfig.json` (dependencies required):\n  ```\n  npx @bedrock-oss/qjs-opt --deps @minecraft/server@^2.2.0 ./scripts\n  ```\n\nUseful flags:\n\n- `--config <path>` – path to a JSON config.\n- `--config-mode <default|merge|override>` – how to combine the supplied config\n  with the built-in defaults.\n- `--deps <a,b,...>` – packages to install into the temporary workspace.\n- `--tsconfig <path>` – force a specific tsconfig file for folder runs.\n- `--workspace <path>` – reuse a pre-created workspace directory.\n\nConfig Modes\n------------\n\n- `default` – use the built-in defaults only.\n- `merge` – default behaviour; merge user rules with defaults.\n- `override` – use only the supplied rules. A config must be provided.\n\nLibrary API\n-----------\n\n```ts\nimport { optimize, resolveConfig, defaultConfig } from \"qjs-opt\";\n\nconst result = optimize({\n  targetPath: \"./addon\",\n  config: \"./my-config.json\",\n  configMode: \"merge\",\n});\n\nconsole.log(result.changed, \"files updated\");\n```\n","readmeFilename":"README.md","_rev":"1-1f5aa91d93d5a8c88a2ed04bcbd0e925"}