{"id":16809499,"url":"https://github.com/feross/arch","last_synced_at":"2025-04-13T07:51:35.477Z","repository":{"id":53972336,"uuid":"68413924","full_name":"feross/arch","owner":"feross","description":"Better `os.arch()` for node and the browser -- detect OS architecture","archived":false,"fork":false,"pushed_at":"2024-02-13T22:50:43.000Z","size":30,"stargazers_count":80,"open_issues_count":8,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-11T09:27:18.015Z","etag":null,"topics":["arch","architecture","javascript","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/feross.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-16T20:53:50.000Z","updated_at":"2024-11-05T07:14:03.000Z","dependencies_parsed_at":"2024-06-18T13:31:37.767Z","dependency_job_id":null,"html_url":"https://github.com/feross/arch","commit_stats":{"total_commits":35,"total_committers":5,"mean_commits":7.0,"dds":0.2857142857142857,"last_synced_commit":"22d2a87d5bce7b3555abf13f4613939c4ddeca0e"},"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Farch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Farch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Farch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/feross%2Farch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/feross","download_url":"https://codeload.github.com/feross/arch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248681494,"owners_count":21144700,"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":["arch","architecture","javascript","nodejs"],"created_at":"2024-10-13T10:13:00.801Z","updated_at":"2025-04-13T07:51:35.453Z","avatar_url":"https://github.com/feross.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# arch [![ci][ci-image]][ci-url] [![npm][npm-image]][npm-url] [![downloads][downloads-image]][downloads-url] [![javascript style guide][standard-image]][standard-url]\n\n[ci-image]: https://img.shields.io/github/workflow/status/feross/arch/ci/master\n[ci-url]: https://github.com/feross/arch/actions\n[npm-image]: https://img.shields.io/npm/v/arch.svg\n[npm-url]: https://npmjs.org/package/arch\n[downloads-image]: https://img.shields.io/npm/dm/arch.svg\n[downloads-url]: https://npmjs.org/package/arch\n[standard-image]: https://img.shields.io/badge/code_style-standard-brightgreen.svg\n[standard-url]: https://standardjs.com\n\n### Better `os.arch()` for node and the browser -- detect OS architecture\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/arch2.svg)](https://saucelabs.com/u/arch2)\n\nThis module is used by [WebTorrent Desktop](http://webtorrent.io/desktop) to\ndetermine if the user is on a 32-bit vs. 64-bit operating system to offer the\nright app installer.\n\nIn Node.js, the `os.arch()` method (and `process.arch` property) returns a string\nidentifying the operating system CPU architecture **for which the Node.js binary\nwas compiled**.\n\nThis is not the same as the **operating system CPU architecture**. For example,\nyou can run Node.js 32-bit on a 64-bit OS. In that situation, `os.arch()` will\nreturn a misleading 'x86' (32-bit) value, instead of 'x64' (64-bit).\n\nUse this package to get the actual operating system CPU architecture.\n\n**BONUS: This package works in the browser too.**\n\n## install\n\n```\nnpm install arch\n```\n\n## usage\n\n```js\nvar arch = require('arch')\nconsole.log(arch()) // always returns 'x64' or 'x86'\n```\n\nIn the browser, there is no spec that defines where this information lives, so we\ncheck all known locations including `navigator.userAgent`, `navigator.platform`,\nand `navigator.cpuClass` to make a best guess.\n\nIf there is no *affirmative indication* that the architecture is 64-bit, then\n32-bit will be assumed. This makes this package perfect for determining what\ninstaller executable to offer to desktop app users. If there is ambiguity, then\nthe user will get the 32-bit installer, which will work fine even for a user with\na 64-bit OS.\n\nFor reference, `x64` means 64-bit and `x86` means 32-bit.\n\nHere is some history behind these naming conventions:\n\n- https://en.wikipedia.org/wiki/X86\n- https://en.wikipedia.org/wiki/IA-32\n- https://en.wikipedia.org/wiki/X86-64\n\n## Node.js proposal - `os.sysarch()`\n\nNote: There is\n[a proposal](https://github.com/nodejs/node-v0.x-archive/issues/2862#issuecomment-103942051)\nto add this functionality to Node.js as `os.sysarch()`.\n\n## license\n\nMIT. Copyright (c) [Feross Aboukhadijeh](http://feross.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Farch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffeross%2Farch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffeross%2Farch/lists"}