{"_id":"@d0bar/frame-budget","name":"@d0bar/frame-budget","dist-tags":{"next":"0.1.0-preview.0","latest":"0.1.0-preview.0"},"versions":{"0.1.0-preview.0":{"name":"@d0bar/frame-budget","version":"0.1.0-preview.0","description":"Chromium main-thread attribution and enforceable browser performance budgets.","license":"MIT","type":"module","sideEffects":false,"publishConfig":{"access":"public"},"exports":{".":{"types":"./dist/index.d.ts","default":"./dist/index.js"},"./attribution":{"types":"./dist/attribution.d.ts","default":"./dist/attribution.js"}},"engines":{"node":">=18"},"peerDependencies":{"@playwright/test":">=1.49.0"},"devDependencies":{"vitest":"^3.2.6"},"repository":{"type":"git","url":"git+https://github.com/big-kahuna-burger/d0bar.git","directory":"packages/frame-budget"},"scripts":{"build":"tsc -p tsconfig.build.json","test":"vitest run"},"_nodeVersion":"24.19.0","_id":"@d0bar/frame-budget@0.1.0-preview.0","dist":{"integrity":"sha512-F/iu8Mwu10QjYZGsMuSx15wUHj6JQmck9N/n5sX/YWVLGQz3IBD5MXmm4wDQMjnlmzBY8lx5YTeHq+FU2ZGtiA==","shasum":"31fc29287403f59ca34beef5a813fbb51cb5dcd6","tarball":"https://registry.npmjs.org/@d0bar/frame-budget/-/frame-budget-0.1.0-preview.0.tgz","fileCount":15,"unpackedSize":22449,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIHAU/RSMe7LuKH2Dwj/NqPwcGA7QRHXt0oODttqt1xqNAiEAgBbCSVBIaJ4Y+3VZE43coqMEAq8X6DMTf6S5upfu74Y="}]},"_npmUser":{"name":"big-kahuna-burger","email":"arandjel.sarenac@gmail.com"},"directories":{},"maintainers":[{"name":"big-kahuna-burger","email":"arandjel.sarenac@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/frame-budget_0.1.0-preview.0_1788930260174_0.9344728185930631"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-09T05:04:19.972Z","0.1.0-preview.0":"2026-09-09T05:04:20.305Z","modified":"2026-09-09T05:04:20.565Z"},"maintainers":[{"name":"big-kahuna-burger","email":"arandjel.sarenac@gmail.com"}],"description":"Chromium main-thread attribution and enforceable browser performance budgets.","repository":{"type":"git","url":"git+https://github.com/big-kahuna-burger/d0bar.git","directory":"packages/frame-budget"},"license":"MIT","readme":"# @d0bar/frame-budget\n\nMeasures how much main-thread script time a URL-matched subject contributes to each Chromium\ntask. It uses CDP tracing outside the product, so the code being measured does not time itself.\n\n`long-animation-frame` and `longtask` both have a 50 ms floor and report the whole frame or task,\nnot one script's share. In-product timers perturb the code they measure. CDP attribution avoids\nthose limits and retains microsecond trace resolution.\n\nThe result covers JavaScript execution. It cannot attribute style recalculation, layout, or paint\nback to the script that caused them. Tracing adds overhead, so measured script time is an upper\nbound. The API deliberately supports Chromium only and fails if no matching script ran.\n\n```ts\nimport { attributedDuring } from \"@d0bar/frame-budget\";\n\nconst result = await attributedDuring(\n  page,\n  (url) => url.includes(\"/widget.js\"),\n  async () => {\n    await page.goto(\"/\");\n  },\n);\n```\n","readmeFilename":"","_rev":"1-e1ac36b50d542852a8982c3bf8c8f375"}