{"_id":"@birbhouse/gamestats","_rev":"2-57d80128d72d5c3c7c55767295f40338","name":"@birbhouse/gamestats","dist-tags":{"next":"1.0.0-next.1","latest":"1.0.0"},"versions":{"1.0.0-next.1":{"name":"@birbhouse/gamestats","version":"1.0.0-next.1","keywords":["game","stats","performance","fps"],"author":{"url":"https://trezy.codes","name":"Trezy","email":"t@trezy.com"},"license":"MIT","_id":"@birbhouse/gamestats@1.0.0-next.1","maintainers":[{"name":"trezy","email":"tre@trezy.com"}],"contributors":[{"name":"Erik Sombroek"}],"homepage":"https://github.com/birbhouse-games/gamestats#readme","bugs":{"url":"https://github.com/birbhouse-games/gamestats/issues"},"dist":{"shasum":"136423171f947b465539dc946c34055d527b76ad","tarball":"https://registry.npmjs.org/@birbhouse/gamestats/-/gamestats-1.0.0-next.1.tgz","fileCount":15,"integrity":"sha512-N7xLbmqrorTFyIDuk+yoUUFuKrBtzCsxeyX6BNM27LPSvJYCKr9hrBdWbh2yB84hQ6g47RAdTWqRQjLQwB3RQQ==","signatures":[{"sig":"MEQCIFhlQkYGdoBlgqTi3F5s/piWGBRrO2TvpwIPpbMtZMrEAiANXIQH5uRFHXPP4GDEvvz1ug0CVXPG4rzeDEe9PSX8Lg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":296027},"main":"build/gamestats.cjs","type":"module","husky":{"hooks":{"pre-commit":"lint-staged"}},"types":"build/gamestats.d.ts","module":"build/gamestats.js","exports":{".":{"import":{"types":"./build/gamestats.d.ts","default":"./build/gamestats.js"},"default":{"types":"./build/gamestats.d.ts","default":"./build/gamestats.browser.js"},"require":{"types":"./build/gamestats.d.ts","default":"./build/gamestats.cjs"}}},"gitHead":"4dff5066eea40dd70a64ed3356914cf49255c8b7","scripts":{"lint":"eslint --config ./eslint.config.js","test":"tsup && vitest run","build":"tsup","watch":"concurrently \"yarn run watch:typescript\" \"yarn run watch:server\"","prepare":"husky install","lint:fix":"eslint --fix","prerelease":"npm run build","test:watch":"vitest","watch:server":"http-server .","watch:typescript":"tsup --watch"},"_npmUser":{"name":"trezy","email":"tre@trezy.com"},"repository":{"url":"git+https://github.com/birbhouse-games/gamestats.git","type":"git"},"_npmVersion":"10.9.2","description":"Javascript performance monitor / game stats library inspired by Unity's graphy","directories":{},"lint-staged":{"*.{ts,js,mjs}":["eslint --cache --fix --max-warnings 0"]},"_nodeVersion":"22.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"yarn@4.9.1","devDependencies":{"tsup":"^8.4.0","husky":"^9.1.7","eslint":"^9.25.1","terser":"^5.39.0","vitest":"^3.1.2","esbuild":"^0.25.3","globals":"^15.15.0","@eslint/js":"^9.25.1","typescript":"^5.8.3","http-server":"^0.12.3","concurrently":"^9.1.2","@types/eslint":"^9.6.1","@eslint/eslintrc":"^3.3.1","typescript-eslint":"^8.31.0","eslint-plugin-jsdoc":"^50.6.10","eslint-plugin-import":"^2.31.0","eslint-plugin-promise":"^7.2.1","eslint-plugin-import-x":"^4.10.6","eslint-plugin-security":"^3.0.1","@types/eslint__eslintrc":"^2.1.2","@birbhouse/eslint-config":"^1.2.0","@typescript-eslint/parser":"8.31.0","@vitest/coverage-istanbul":"^3.1.2","esbuild-plugin-umd-wrapper":"^3.0.0","eslint-plugin-editorconfig":"^4.0.3","@trezy-studios/eslint-config":"^2.2.2","eslint-plugin-optimize-regex":"^1.2.1","eslint-plugin-unused-imports":"^4.1.4","@types/eslint-plugin-security":"^3.0.0","@typescript-eslint/eslint-plugin":"8.31.0","eslint-plugin-sort-class-members":"^1.21.0","@birbhouse/eslint-config-typescript":"^1.1.0"},"_npmOperationalInternal":{"tmp":"tmp/gamestats_1.0.0-next.1_1745526091617_0.05149044611097908","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@birbhouse/gamestats","version":"1.0.0","description":"Javascript performance monitor / game stats library inspired by Unity's graphy","type":"module","main":"build/gamestats.cjs","module":"build/gamestats.js","types":"build/gamestats.d.ts","exports":{".":{"import":{"types":"./build/gamestats.d.ts","default":"./build/gamestats.js"},"require":{"types":"./build/gamestats.d.ts","default":"./build/gamestats.cjs"},"default":{"types":"./build/gamestats.d.ts","default":"./build/gamestats.browser.js"}}},"scripts":{"build":"tsup","lint":"eslint --config ./eslint.config.js","lint:fix":"eslint --fix","prepare":"husky install","prerelease":"npm run build","test":"tsup && vitest run","test:watch":"vitest","watch":"concurrently \"yarn run watch:typescript\" \"yarn run watch:server\"","watch:typescript":"tsup --watch","watch:server":"http-server ."},"husky":{"hooks":{"pre-commit":"lint-staged"}},"lint-staged":{"*.{ts,js,mjs}":["eslint --cache --fix --max-warnings 0"]},"repository":{"type":"git","url":"git+https://github.com/birbhouse-games/gamestats.git"},"keywords":["game","stats","performance","fps"],"author":{"name":"Trezy","email":"t@trezy.com","url":"https://trezy.codes"},"contributors":[{"name":"Erik Sombroek"}],"license":"MIT","bugs":{"url":"https://github.com/birbhouse-games/gamestats/issues"},"homepage":"https://github.com/birbhouse-games/gamestats#readme","devDependencies":{"@birbhouse/eslint-config":"^1.2.0","@birbhouse/eslint-config-typescript":"^1.1.0","@eslint/eslintrc":"^3.3.1","@eslint/js":"^9.25.1","@trezy-studios/eslint-config":"^2.2.2","@types/eslint":"^9.6.1","@types/eslint-plugin-security":"^3.0.0","@types/eslint__eslintrc":"^2.1.2","@typescript-eslint/eslint-plugin":"8.31.0","@typescript-eslint/parser":"8.31.0","@vitest/coverage-istanbul":"^3.1.2","concurrently":"^9.1.2","esbuild":"^0.25.3","esbuild-plugin-umd-wrapper":"^3.0.0","eslint":"^9.25.1","eslint-plugin-editorconfig":"^4.0.3","eslint-plugin-import":"^2.31.0","eslint-plugin-import-x":"^4.10.6","eslint-plugin-jsdoc":"^50.6.10","eslint-plugin-optimize-regex":"^1.2.1","eslint-plugin-promise":"^7.2.1","eslint-plugin-security":"^3.0.1","eslint-plugin-sort-class-members":"^1.21.0","eslint-plugin-unused-imports":"^4.1.4","globals":"^15.15.0","http-server":"^0.12.3","husky":"^9.1.7","terser":"^5.39.0","tsup":"^8.4.0","typescript":"^5.8.3","typescript-eslint":"^8.31.0","vitest":"^3.1.2"},"publishConfig":{"access":"public"},"packageManager":"yarn@4.9.1","_id":"@birbhouse/gamestats@1.0.0","gitHead":"4dff5066eea40dd70a64ed3356914cf49255c8b7","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-u8CxDQsPKjGNU0Crj81byVK2taqgiN12GfVeJC7BY2A3BLcIElU9bh3M1ZGGqML2qZrJuiNDEiuAH8fqs4RstA==","shasum":"d2c43e34dfac8f3972816f9bd37b736cd0cba761","tarball":"https://registry.npmjs.org/@birbhouse/gamestats/-/gamestats-1.0.0.tgz","fileCount":15,"unpackedSize":296020,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCDJUK43vlTcpeL8mYl71zK5gHHOS9iYkMxaPEV5Fw2UAIhANUXVMVPuZuMxHxWPeRsg5eI4/1WJSxZdOlnAWV97acf"}]},"_npmUser":{"name":"trezy","email":"tre@trezy.com"},"directories":{},"maintainers":[{"name":"trezy","email":"tre@trezy.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/gamestats_1.0.0_1745526290139_0.3606491176684501"},"_hasShrinkwrap":false}},"time":{"created":"2025-04-24T20:21:31.558Z","modified":"2025-04-24T20:24:50.536Z","1.0.0-next.1":"2025-04-24T20:21:31.834Z","1.0.0":"2025-04-24T20:24:50.366Z"},"bugs":{"url":"https://github.com/birbhouse-games/gamestats/issues"},"author":{"name":"Trezy","email":"t@trezy.com","url":"https://trezy.codes"},"license":"MIT","homepage":"https://github.com/birbhouse-games/gamestats#readme","keywords":["game","stats","performance","fps"],"repository":{"type":"git","url":"git+https://github.com/birbhouse-games/gamestats.git"},"description":"Javascript performance monitor / game stats library inspired by Unity's graphy","contributors":[{"name":"Erik Sombroek"}],"maintainers":[{"name":"trezy","email":"tre@trezy.com"}],"readme":"# `@birbhouse/gamestats`\n\n> **Track performance stats in your game.**\n\n[![Version][version-badge]][package]\n[![BSD-3-Clause License][license-badge]][license]\n[![Downloads][downloads-badge]][npmtrends]\n[![Bundle size][bundlephobia-badge]][bundlephobia]\n\n<!-- [![Code Coverage][coveralls-badge]][coveralls] -->\n\n[![Build status][build-status-badge]][build-status]\n[![Dependencies][libraries.io-badge]][libraries.io]\n[![Maintainability][codeclimate-badge]][codeclimate]\n[![Code of Conduct][code-of-conduct-badge]][code-of-conduct]\n<!-- [![PRs Welcome][prs-badge]][prs] -->\n\n[![Watch on GitHub][github-watch-badge]][github-watch]\n[![Star on GitHub][github-star-badge]][github-star]\n\n## Example\n![Image of Gamestats](https://i.imgur.com/nCMwblD.gif)\n\nFor a live example click [here](https://birbhouse-games.github.io/gamestats/example/)\n\n**Features**\n- FPS counter, shows the average / min / max for the visible history\n- MS milliseconds that where needed to render the last frame\n- Memory usage maximum (reserved) and allocated memory for the context (*Chrome only*)\n- Custom graphs\n\n## Installation\n\nWith [npm](https://npmjs.org) do:\n\n```bash\nnpm install @birbhouse/gamestats\n```\n\n## Usage\n\n```js\nimport { GameStats } from '@birbhouse/gamestats'\n\nconst stats = new GameStats()\n\ndocument.body.appendChild( stats.dom )\n\nfunction animate() {\n\tstats.begin()\n\t// game update goes here\n\n\tstats.begin('physics')\n\t// the graph will deterministically assign a color based on the label\n\tphysics()\n\tstats.end('physics')\n\n\tstats.begin('render', '#6cc644')\n\t// optional second color parameter\n\trender()\n\tstats.end('render')\n\n\tstats.end()\n\n\trequestAnimationFrame( animate )\n}\n\nrequestAnimationFrame( animate )\n```\nSee also this code [example](https://github.com/birbhouse-games/gamestats/blob/main/example/index.html)\n\n**Optional configuration**\n\n```js\nconst config = {\n\tautoPlace:true, /* auto place in the dom */\n\ttargetFPS: 60, /* the target max FPS */\n\tredrawInterval: 50, /* the interval in MS for redrawing the FPS graph */\n\tmaximumHistory: 100, /* the length of the visual graph history in frames */\n\tscale: 1.0, /* the scale of the canvas */\n\tmemoryUpdateInterval: 1000, /* the interval for measuring the memory */\n\tmemoryMaxHistory: 60 * 10, /* the max amount of memory measures */\n\n\t// Styling props\n\tFONT_FAMILY: 'Arial',\n\tCOLOR_FPS_BAR: '#34cfa2',\n\tCOLOR_FPS_AVG: '#FFF',\n\tCOLOR_TEXT_LABEL: '#FFF',\n\tCOLOR_TEXT_TO_LOW: '#eee207',\n\tCOLOR_TEXT_BAD: '#d34646',\n\tCOLOR_TEXT_TARGET: '#d249dd',\n\tCOLOR_BG: '#333333',\n}\n\nconst stats = new GameStats(config);\n```\n\n## Prior Art\n* [gamestats.js](https://github.com/ErikSom/gamestats) was originally written by [ErikSom](https://github.com/ErikSom)\n* [Stats.js](https://github.com/mrdoob/stats.js) by mr doob\n* [Unity Graphy](https://github.com/Tayx94/graphy) by tayx94\n\n\n\n\n\n\n[bundlephobia]: https://bundlephobia.com/result?p=@birbhouse/gamestats\n[bundlephobia-badge]: https://img.shields.io/bundlephobia/minzip/@birbhouse/gamestats.svg?style=flat-square\n[build-status]: https://github.com/birbhouse-games/gamestats/actions\n[build-status-badge]: https://img.shields.io/github/actions/workflow/status/birbhouse-games/gamestats/release.yml?style=flat-square\n[code-of-conduct]: CODE_OF_CONDUCT.md\n[code-of-conduct-badge]: https://img.shields.io/badge/code%20of-conduct-ff69b4.svg?style=flat-square\n[codeclimate]: https://codeclimate.com/github/birbhouse-games/gamestats\n[codeclimate-badge]: https://img.shields.io/codeclimate/maintainability/birbhouse-games/gamestats.svg?style=flat-square\n[coveralls]: https://coveralls.io/github/birbhouse-games/gamestats\n[coveralls-badge]: https://img.shields.io/coveralls/birbhouse-games/gamestats.svg?style=flat-square\n[downloads-badge]: https://img.shields.io/npm/dm/@birbhouse/gamestats.svg?style=flat-square\n[github-watch]: https://github.com/birbhouse-games/gamestats/watchers\n[github-watch-badge]: https://img.shields.io/github/watchers/birbhouse-games/gamestats.svg?style=social\n[github-star]: https://github.com/birbhouse-games/gamestats/stargazers\n[github-star-badge]: https://img.shields.io/github/stars/birbhouse-games/gamestats.svg?style=social\n[libraries.io]: https://libraries.io/npm/@birbhouse/gamestats\n[libraries.io-badge]: https://img.shields.io/librariesio/release/npm/@birbhouse/gamestats.svg?style=flat-square\n[license]: LICENSE\n[license-badge]: https://img.shields.io/npm/l/@birbhouse/gamestats.svg?style=flat-square\n[npmtrends]: https://www.npmtrends.com/@birbhouse/gamestats\n[package]: https://npmjs.com/package/@birbhouse/gamestats\n[prs]: CONTRIBUTING.md\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square\n[version-badge]: https://img.shields.io/npm/v/@birbhouse/gamestats.svg?style=flat-square\n","readmeFilename":"README.md"}