{"id":28391486,"url":"https://github.com/react-native-community/hermes-profile-transformer","last_synced_at":"2025-06-25T21:31:14.377Z","repository":{"id":42795940,"uuid":"271193440","full_name":"react-native-community/hermes-profile-transformer","owner":"react-native-community","description":"TypeScript tool for converting Hermes Sampling Profiler output to Chrome Dev Tools format","archived":false,"fork":false,"pushed_at":"2024-01-10T02:54:34.000Z","size":2939,"stargazers_count":88,"open_issues_count":23,"forks_count":10,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-05-31T20:04:44.235Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/react-native-community.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-06-10T06:08:54.000Z","updated_at":"2025-04-07T19:10:12.000Z","dependencies_parsed_at":"2024-01-23T21:29:04.937Z","dependency_job_id":"4aca213a-37ee-49c0-a17d-11f8170f6323","html_url":"https://github.com/react-native-community/hermes-profile-transformer","commit_stats":{"total_commits":81,"total_committers":7,"mean_commits":"11.571428571428571","dds":"0.37037037037037035","last_synced_commit":"8349bca4f147b45c437dfcd035e39b76fc99272d"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/react-native-community/hermes-profile-transformer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-community%2Fhermes-profile-transformer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-community%2Fhermes-profile-transformer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-community%2Fhermes-profile-transformer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-community%2Fhermes-profile-transformer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/react-native-community","download_url":"https://codeload.github.com/react-native-community/hermes-profile-transformer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/react-native-community%2Fhermes-profile-transformer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261955921,"owners_count":23235976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-05-31T09:39:14.513Z","updated_at":"2025-06-25T21:31:14.371Z","avatar_url":"https://github.com/react-native-community.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Hermes Profile Transformer\n\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"npm\" src=\"https://img.shields.io/npm/v/hermes-profile-transformer\"\u003e\n\u003cimg alt=\"node-current\" src=\"https://img.shields.io/node/v/hermes-profile-transformer\"\u003e\n\u003cimg alt=\"npm bundle size\" src=\"https://img.shields.io/bundlephobia/min/hermes-profile-transformer\"\u003e\n\u003cimg alt=\"NPM\" src=\"https://img.shields.io/npm/l/hermes-profile-transformer\"\u003e\n\u003cimg alt=\"npm type definitions\" src=\"https://img.shields.io/npm/types/hermes-profile-transformer\"\u003e\n\u003c/p\u003e\n\nVisualize Facebook's [Hermes JavaScript runtime](https://github.com/facebook/hermes) profile traces in Chrome Developer Tools.\n\n![Demo Profile](https://raw.githubusercontent.com/react-native-community/hermes-profile-transformer/master/assets/convertedProfile.png)\n\n## Overview\n\nThe Hermes runtime, used by React Native for Android, is able to output [Chrome Trace Events](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview) in JSON Object Format.\n\nThis TypeScript package converts Hermes CPU profiles to Chrome Developer Tools compatible JSON Array Format, and enriches it with line and column numbers and event categories from JavaScript source maps.\n\n## Usage\n\nIf you're using `hermes-profile-transformer` to debug React Native Android applications, you can use the [React Native CLI](https://github.com/react-native-community/cli) `react-native profile-hermes` command, which uses this package to convert the downloaded Hermes profiles automatically.\n\n### As a standalone package\n\n```js\nconst transformer = require('hermes-profile-transformer').default;\nconst { writeFileSync } = require('fs');\n\nconst hermesCpuProfilePath = './testprofile.cpuprofile';\nconst sourceMapPath = './index.map';\nconst sourceMapBundleFileName = 'index.bundle.js';\n\ntransformer(\n  // profile path is required\n  hermesCpuProfilePath,\n  // source maps are optional\n  sourceMap,\n  sourceMapBundleFileName\n)\n  .then(events =\u003e {\n    // write converted trace to a file\n    return writeFileSync(\n      './chrome-supported.json',\n      JSON.stringify(events, null, 2),\n      'utf-8'\n    );\n  })\n  .catch(err =\u003e {\n    console.log(err);\n  });\n```\n\n## Creating Hermes CPU Profiles\n\n## Opening converted profiles in Chrome Developer Tools\n\nOpen Developer Tools in Chrome, navigate to the **Performance** tab, and use the **Load profile...** feature.\n\n![Loading the Profile](https://raw.githubusercontent.com/react-native-community/hermes-profile-transformer/master/assets/loading.png)\n\n## API\n\n### transformer(profilePath: string, sourceMapPath?: string, bundleFileName?: string)\n\n#### Parameters\n\n| Parameter      | Type   | Required | Description                                                                                                                                                               |\n| -------------- | ------ | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| profilePath    | string | Yes      | Path to a JSON-formatted `.cpuprofile` file created by the Hermes runtime                                                                                                 |\n| sourceMapPath  | string | No       | Path to a [source-map](https://www.npmjs.com/package/source-map) compatible Source Map file                                                                               |\n| bundleFileName | string | No       | If `sourceMapPath` is provided, you need to also provide the name of the JavaScript bundle file that the source map applies to. This file does not need to exist on disk. |\n\n#### Returns\n\n`Promise\u003cDurationEvent[]\u003e`, where `DurationEvent` is as defined in [EventInterfaces.ts](src/types/EventInterfaces.ts).\n\n## Resources\n\n- [Using Hermes with React Native](https://reactnative.dev/docs/hermes).\n- [Chrome Trace Event Format](https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU/preview). Hermes uses the JSON Object format.\n- [Measuring JavaScript performance in Chrome](https://developers.google.com/web/tools/chrome-devtools/evaluate-performance/reference)\n\n## LICENSE\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-community%2Fhermes-profile-transformer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freact-native-community%2Fhermes-profile-transformer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freact-native-community%2Fhermes-profile-transformer/lists"}