{"id":25836055,"url":"https://github.com/bugsplat-git/elfy","last_synced_at":"2026-06-03T20:31:31.908Z","repository":{"id":221545477,"uuid":"754665049","full_name":"BugSplat-Git/elfy","owner":"BugSplat-Git","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-29T20:52:42.000Z","size":25,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-01T11:28:41.382Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BugSplat-Git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-08T14:32:54.000Z","updated_at":"2024-02-08T15:51:00.000Z","dependencies_parsed_at":"2024-02-08T17:10:40.101Z","dependency_job_id":null,"html_url":"https://github.com/BugSplat-Git/elfy","commit_stats":null,"previous_names":["bobbyg603/elfy"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Felfy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Felfy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Felfy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BugSplat-Git%2Felfy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BugSplat-Git","download_url":"https://codeload.github.com/BugSplat-Git/elfy/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241304299,"owners_count":19941100,"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-03-01T01:38:59.491Z","updated_at":"2026-06-03T20:31:31.901Z","avatar_url":"https://github.com/BugSplat-Git.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![bugsplat-github-banner-basic-outline](https://user-images.githubusercontent.com/20464226/149019306-3186103c-5315-4dad-a499-4fd1df408475.png)](https://bugsplat.com)\n\u003cbr/\u003e\n\n# \u003cdiv align=\"center\"\u003eBugSplat\u003c/div\u003e\n\n### **\u003cdiv align=\"center\"\u003eCrash and error reporting built for busy developers.\u003c/div\u003e**\n\n\u003cdiv align=\"center\"\u003e\n    \u003ca href=\"https://twitter.com/BugSplatCo\"\u003e\n        \u003cimg alt=\"Follow @bugsplatco on Twitter\" src=\"https://img.shields.io/twitter/follow/bugsplatco?label=Follow%20BugSplat\u0026style=social\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://discord.gg/bugsplat\"\u003e\n        \u003cimg alt=\"Join BugSplat on Discord\" src=\"https://img.shields.io/discord/664965194799251487?label=Join%20Discord\u0026logo=Discord\u0026style=social\"\u003e\n    \u003c/a\u003e\n\u003c/div\u003e\n\n\u003cbr/\u003e\n\n# elfy\n\nA tiny utility for parsing ELF/SELF files. Works in both Node.js and browsers.\n\n## Usage\n\n1. Install this package\n\n```sh\nnpm i @bugsplat/elfy\n```\n\n2. Create an instance of `ElfFile` by passing a `DataSource`. The library provides several built-in data sources:\n\n### Browser (with File input)\n\n```ts\nimport { ElfFile, BlobDataSource } from '@bugsplat/elfy';\n\n// From a file input element\nconst file = document.getElementById('file-input').files[0];\nconst dataSource = new BlobDataSource(file);\nconst elfFile = new ElfFile(dataSource);\n```\n\n### Browser (with fetch)\n\n```ts\nimport { ElfFile, BlobDataSource } from '@bugsplat/elfy';\n\nconst response = await fetch('https://example.com/file.elf');\nconst blob = await response.blob();\nconst dataSource = new BlobDataSource(blob);\nconst elfFile = new ElfFile(dataSource);\n```\n\n### Node.js (with FileHandle for large files)\n\n```ts\nimport { open } from 'node:fs/promises';\nimport { ElfFile, DataSource } from '@bugsplat/elfy';\n\n// Create a custom DataSource for Node.js file handles\nclass FileHandleDataSource implements DataSource {\n  constructor(private fileHandle) {}\n\n  async read(offset: number, length: number): Promise\u003cUint8Array\u003e {\n    const buffer = new Uint8Array(length);\n    const { bytesRead } = await this.fileHandle.read(buffer, 0, length, offset);\n    return buffer.slice(0, bytesRead);\n  }\n}\n\nconst fileHandle = await open('path/to/elf/file', 'r');\ntry {\n  const dataSource = new FileHandleDataSource(fileHandle);\n  const elfFile = new ElfFile(dataSource);\n  // ... use elfFile\n} finally {\n  await fileHandle.close();\n}\n```\n\n### In-memory buffer\n\n```ts\nimport { ElfFile, BufferDataSource } from '@bugsplat/elfy';\n\n// From an ArrayBuffer or Uint8Array already in memory\nconst dataSource = new BufferDataSource(arrayBuffer);\nconst elfFile = new ElfFile(dataSource);\n```\n\n3. Read the contents of a section using `readSection`. This method throws if the section does not exist.\n\n```ts\nconst contents: Uint8Array = await elfFile.readSection('.note.gnu.build-id');\n```\n\n4. You can also safely read the contents of a section using `tryReadSection`.\n\n```ts\nconst { success, section } = await elfFile.tryReadSection('.note.gnu.build-id');\n```\n\n## Data Sources\n\nThe library uses a `DataSource` interface to abstract reading bytes from any source:\n\n```ts\ninterface DataSource {\n  read(offset: number, length: number): Promise\u003cUint8Array\u003e;\n}\n```\n\nBuilt-in implementations:\n\n- **`BlobDataSource`** - For browser `Blob`/`File` objects. Reads only the requested bytes using `Blob.slice()`.\n- **`BufferDataSource`** - For in-memory `Uint8Array` or `ArrayBuffer` data.\n\nYou can create custom implementations for other sources (e.g., Node.js `FileHandle`, HTTP range requests, etc.).\n\n## 🐛 About\n\n[BugSplat](https://bugsplat.com) is a software crash and error reporting service with support for game engines like [Unreal Engine](https://docs.bugsplat.com/introduction/getting-started/integrations/game-development/unreal-engine), and supports platforms such as [PlayStation](https://docs.bugsplat.com/introduction/getting-started/integrations/game-development/playstation), [Xbox](https://docs.bugsplat.com/introduction/getting-started/integrations/game-development/xbox) and [many more](https://docs.bugsplat.com/introduction/getting-started/integrations). BugSplat automatically captures critical diagnostic data such as stack traces, log files, and other runtime information. BugSplat also provides automated incident notifications, a convenient dashboard for monitoring trends and prioritizing engineering efforts, and integrations with popular development tools to maximize productivity and ship more profitable software.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Felfy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugsplat-git%2Felfy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugsplat-git%2Felfy/lists"}