{"_id":"@alexkratky/rpi-info","_rev":"6-40ddb2d6b3141aa9cc14e766e4dc4c0c","name":"@alexkratky/rpi-info","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.0":{"name":"@alexkratky/rpi-info","version":"1.0.0","keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"author":{"name":"AlexKratky"},"license":"ISC","_id":"@alexkratky/rpi-info@1.0.0","maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"dist":{"shasum":"ec3fe865a6081e753fd1ac34459309fdba91a3b9","tarball":"https://registry.npmjs.org/@alexkratky/rpi-info/-/rpi-info-1.0.0.tgz","fileCount":8,"integrity":"sha512-vWxVgCzpxa4oH+c0vsGZ5ilMneFOvAIJg5pZfseiwtACmTX7CK9Zi+8cBD59/pdOw1mw9CZi1WxoZSoolt3Hww==","signatures":[{"sig":"MEQCIHXXFpzO41U/je/BB4O1NAmHUMgmCg/3/QYNkCdJeMm7AiAl0QoiHcEherW3OEwfSI0AL56NbXEzUqaziBimuUsxyw==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33245},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"db5e2891b34bf2b8fd5f4f07a7daa299d46b498c","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"alexkratky","email":"alex@panx.dev"},"_npmVersion":"10.5.0","description":"Detect Raspberry Pi model","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.2","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^20.14.10"},"_npmOperationalInternal":{"tmp":"tmp/rpi-info_1.0.0_1720699188903_0.5562055638653789","host":"s3://npm-registry-packages"}},"1.0.1":{"name":"@alexkratky/rpi-info","version":"1.0.1","keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"author":{"name":"AlexKratky"},"license":"ISC","_id":"@alexkratky/rpi-info@1.0.1","maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"homepage":"https://github.com/AlexKratky/rpi-info","bugs":{"url":"https://github.com/AlexKratky/rpi-info/issues"},"dist":{"shasum":"e0b6c85b8a6a766224fc8529cdf68827286a21b9","tarball":"https://registry.npmjs.org/@alexkratky/rpi-info/-/rpi-info-1.0.1.tgz","fileCount":8,"integrity":"sha512-e4JGNbTYG0PmyLO6m0rVU28GXKr91G/02Mn/EwDjv+jyiBdATmpkCBsLykCihrze6dwP3tJj5b9unME03f0kiA==","signatures":[{"sig":"MEUCICdgvZ8rHUiPal3J+RLxUUgz4GrYGcI57Y7TnG8ThruXAiEAvU4jbmogGphIg6KQRgfBxloZL9azemcKQJDXo7jSoGw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33403},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"f1fc08fe260224b4f613ad2b62722c756fea720a","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"alexkratky","email":"alex@panx.dev"},"repository":{"url":"git+https://github.com/AlexKratky/rpi-info.git","type":"git"},"_npmVersion":"10.5.0","description":"Detect Raspberry Pi model","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.2","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^20.14.10"},"_npmOperationalInternal":{"tmp":"tmp/rpi-info_1.0.1_1720699292237_0.3197780884853145","host":"s3://npm-registry-packages"}},"1.0.2":{"name":"@alexkratky/rpi-info","version":"1.0.2","keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"author":{"name":"AlexKratky"},"license":"ISC","_id":"@alexkratky/rpi-info@1.0.2","maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"homepage":"https://github.com/AlexKratky/rpi-info","bugs":{"url":"https://github.com/AlexKratky/rpi-info/issues"},"dist":{"shasum":"43dde19633285a74576c4ca155cc5b6eff086dc6","tarball":"https://registry.npmjs.org/@alexkratky/rpi-info/-/rpi-info-1.0.2.tgz","fileCount":8,"integrity":"sha512-s5vlbEeOaGVLOdMbqpeQMzsz8rLZ4KzzziYzIUwSNhbnCywROtgXXQoLEry1fK/6Yww7hVZC573a9t312DTn9Q==","signatures":[{"sig":"MEUCIDqmP6c22LbEXRXsWNkxWFnleMGKPP7wI8duPG77t+ePAiEAkBFKnZ6CBBVmH/CeN7eu5QaY9df7FfcHbkMNbwkUos0=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":33828},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"3ff3ea55839265268dc16f998d6430601e97cf56","scripts":{"test":"jest","build":"tsc"},"_npmUser":{"name":"alexkratky","email":"alex@panx.dev"},"repository":{"url":"git+https://github.com/AlexKratky/rpi-info.git","type":"git"},"_npmVersion":"10.5.0","description":"Detect Raspberry Pi model","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","ts-jest":"^29.2.2","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^20.14.10"},"_npmOperationalInternal":{"tmp":"tmp/rpi-info_1.0.2_1720699968934_0.5479203542466959","host":"s3://npm-registry-packages"}},"1.0.4":{"name":"@alexkratky/rpi-info","version":"1.0.4","keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"author":{"name":"AlexKratky"},"license":"ISC","_id":"@alexkratky/rpi-info@1.0.4","maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"homepage":"https://github.com/AlexKratky/rpi-info","bugs":{"url":"https://github.com/AlexKratky/rpi-info/issues"},"dist":{"shasum":"8d9edc276b81f0ae392e7eb9c7bd312c1369f798","tarball":"https://registry.npmjs.org/@alexkratky/rpi-info/-/rpi-info-1.0.4.tgz","fileCount":10,"integrity":"sha512-23XWlLH5CglKkqUERY8G2f5ovpNbgrLjA24/t9F74M21z9JcSdPADlY3YJ14Dllhn36TAC8Psqi3p5jPPlEAdQ==","signatures":[{"sig":"MEQCIGWgDW3sFzpRHmKX5r0INCFhyJGZN5FDFWXZzqJ4s3tyAiAcqoUPdkd8TvBUeX7mh0YsUEh31oQ3G5m924syYQvprA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":35203},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"a71cad7c130b64c9d634ddc2cb75142f6bfec9c9","scripts":{"lint":"eslint","test":"jest","build":"tsc"},"_npmUser":{"name":"alexkratky","email":"alex@panx.dev"},"repository":{"url":"git+https://github.com/AlexKratky/rpi-info.git","type":"git"},"_npmVersion":"10.5.0","description":"Detect Raspberry Pi model","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.5.0","globals":"^15.8.0","ts-jest":"^29.2.2","@eslint/js":"^9.6.0","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^20.14.10","typescript-eslint":"^7.16.0"},"_npmOperationalInternal":{"tmp":"tmp/rpi-info_1.0.4_1720702282670_0.8029754798795832","host":"s3://npm-registry-packages"}},"1.0.5":{"name":"@alexkratky/rpi-info","version":"1.0.5","keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"author":{"name":"AlexKratky"},"license":"ISC","_id":"@alexkratky/rpi-info@1.0.5","maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"homepage":"https://github.com/AlexKratky/rpi-info","bugs":{"url":"https://github.com/AlexKratky/rpi-info/issues"},"dist":{"shasum":"bf8afba060c8ce3af15ee81919091e8483d1aa82","tarball":"https://registry.npmjs.org/@alexkratky/rpi-info/-/rpi-info-1.0.5.tgz","fileCount":10,"integrity":"sha512-fT06+lb8UYsk/QUKpRn3R57sQDJ2MoHidZQipz92JhuTsGLGYqV0eA4imwG5Cib2jpwon4CWHJ5VwlZc1azGLA==","signatures":[{"sig":"MEUCIQCraZwiz2MUlFiKBevZEPrlL2HJEn2Bgnz4iGw83LWt/QIgO8FEEBWQOqAPwU9DTqZVrGqChmDBqo7MXOrB+LHOAeQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":36216},"main":"dist/index.js","types":"dist/index.d.ts","gitHead":"77e1cd50f51f470e82631e29f2fb51e3016d9ee1","scripts":{"lint":"eslint","test":"jest","build":"tsc"},"_npmUser":{"name":"alexkratky","email":"alex@panx.dev"},"repository":{"url":"git+https://github.com/AlexKratky/rpi-info.git","type":"git"},"_npmVersion":"10.5.0","description":"Detect Raspberry Pi model","directories":{},"_nodeVersion":"20.11.1","_hasShrinkwrap":false,"devDependencies":{"jest":"^29.7.0","eslint":"^8.5.0","globals":"^15.8.0","ts-jest":"^29.2.2","@eslint/js":"^9.6.0","typescript":"^5.5.3","@types/jest":"^29.5.12","@types/node":"^20.14.10","typescript-eslint":"^7.16.0"},"_npmOperationalInternal":{"tmp":"tmp/rpi-info_1.0.5_1740327458330_0.3025958495640233","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alexkratky/rpi-info","version":"1.1.0","description":"Detect Raspberry Pi model","main":"dist/index.js","types":"dist/index.d.ts","repository":{"type":"git","url":"git+https://github.com/AlexKratky/rpi-info.git"},"homepage":"https://github.com/AlexKratky/rpi-info","scripts":{"build":"tsc","test":"jest","lint":"eslint"},"keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"author":{"name":"AlexKratky"},"license":"ISC","devDependencies":{"@eslint/js":"^9.6.0","@types/jest":"^29.5.12","@types/node":"^20.14.10","eslint":"^8.5.0","globals":"^15.8.0","jest":"^29.7.0","ts-jest":"^29.2.2","typescript":"^5.5.3","typescript-eslint":"^7.16.0"},"_id":"@alexkratky/rpi-info@1.1.0","gitHead":"2a99aab2161bbacc5e764bb112d60c22a1f1998c","bugs":{"url":"https://github.com/AlexKratky/rpi-info/issues"},"_nodeVersion":"22.19.0","_npmVersion":"10.9.3","dist":{"integrity":"sha512-JeDQMXX57eY4OIWfgejI7FByUZR8cqmDANi3/tMXIJlPHDAQdBBxpOCNsYrDAisC2v79j9iD4Gcjman/2YmlrQ==","shasum":"088a8a4042ee24862605388e83ffa6a53f583424","tarball":"https://registry.npmjs.org/@alexkratky/rpi-info/-/rpi-info-1.1.0.tgz","fileCount":10,"unpackedSize":45634,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDJdWwUFhZTlt1WkCnsGTXE7K99AS8piIr9W3oYwiIFTAIhALzZ78xNQE5apvV1dGqSUqLCrpJI6RaAVUbSS2zGvYnY"}]},"_npmUser":{"name":"alexkratky","email":"alex@panx.dev"},"directories":{},"maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/rpi-info_1.1.0_1770913750633_0.3112911177115347"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-11T11:59:48.831Z","modified":"2026-02-12T16:29:10.932Z","1.0.0":"2024-07-11T11:59:49.079Z","1.0.1":"2024-07-11T12:01:32.535Z","1.0.2":"2024-07-11T12:12:49.158Z","1.0.4":"2024-07-11T12:51:22.809Z","1.0.5":"2025-02-23T16:17:38.525Z","1.1.0":"2026-02-12T16:29:10.811Z"},"bugs":{"url":"https://github.com/AlexKratky/rpi-info/issues"},"author":{"name":"AlexKratky"},"license":"ISC","homepage":"https://github.com/AlexKratky/rpi-info","keywords":["detect","model","raspberrypi","raspberry","pi","rpi"],"repository":{"type":"git","url":"git+https://github.com/AlexKratky/rpi-info.git"},"description":"Detect Raspberry Pi model","maintainers":[{"name":"alexkratky","email":"alex@panx.dev"}],"readme":"# @alexkratky/rpi-info\n\nA simple package to detect if your app is currently running on Raspberry Pi and also to detect which one.\n\n## Installation\n\n```bash\nnpm i @alexkratky/rpi-info\n# or\nyarn add @alexkratky/rpi-info\n```\n\n## Usage\n\n```ts\nimport { RaspberryPiInfo } from '@alexkratky/rpi-info';\n\nconst raspberryPiInfo = new RaspberryPiInfo();\n\nconsole.log(raspberryPiInfo.detect());\n```\n\nExpected output on Raspberry Pi device:\n\n```js\n{\n    isRaspberry: true,\n    model: '5',\n    fullModelName: 'Raspberry Pi 5',\n    fullModelNameWithRam: 'Raspberry Pi 5 - 4GB',\n    ram: '4GB',\n    manufacturer: 'Sony UK',\n    revisionCode: 'c04170'\n}\n```\n\non non-Raspberry Pi device the output will be:\n\n```js\n{\n    isRaspberry: false,\n    model: null,\n    fullModelName: null,\n    fullModelNameWithRam: null,\n    ram: null,\n    manufacturer: null,\n    revisionCode: null\n}\n```\n\n## Custom usage\n\nThis package uses detection based on revision code presented in `/proc/cpuinfo` (you can list that on your machine by typing `cat /proc/cpuinfo` in your terminal) and uses that revision code to detect which model you are currently using. I will try to keep the list updated, but in case there is a new version of Raspberry Pi, or some custom, you can always pass additional revision codes to the constructor as the first parameter (You can add a completly new one, or override the existing):\n\n```ts\nimport { RaspberryPiInfo } from '@alexkratky/rpi-info';\n\nconst raspberryPiInfo = new RaspberryPiInfo(\n    {'c04170': { model: '0', ram: '128GB', manufacturer: 'Custom' }},\n    {'customRevisionCode': { model: 'New Raspberry Pi 6?', ram: '16GB', manufacturer: 'Custom' }},\n);\n\nconsole.log(raspberryPiInfo.detect());\n```\n\nExpected output on Raspberry Pi device:\n\n```js\n{\n    isRaspberry: true,\n    model: '0',\n    fullModelName: 'Raspberry Pi 0',\n    fullModelNameWithRam: 'Raspberry Pi 0 - 128GB',\n    ram: '128GB',\n    manufacturer: 'Custom',\n    revisionCode: 'c04170'\n}\n```\n\n\nBy default, the fullModelName and fullModelNameWithRam start with 'Raspberry Pi', you can modify this behavior by passing the base name to the constructor as a second parameter:\n\n```ts\nimport { RaspberryPiInfo } from '@alexkratky/rpi-info';\n\nconst raspberryPiInfo = new RaspberryPiInfo({}, 'Custom PI');\n\nconsole.log(raspberryPiInfo.detect());\n```\n\nExpected output on Raspberry Pi device:\n\n```js\n{\n    isRaspberry: true,\n    model: '5',\n    fullModelName: 'Custom PI 5',\n    fullModelNameWithRam: 'Custom PI 5 - 4GB',\n    ram: '4GB',\n    manufacturer: 'Sony UK',\n    revisionCode: 'c04170'\n}\n```\n\n### Usage in commonjs\n\nRecommended usage is in the module, but if you are using CommonJS, the import and the usage should look like this:\n\n```ts\nconst rpiInfo = require('@alexkratky/rpi-info');\n\nconst raspberryPiInfo = new rpiInfo.RaspberryPiInfo();\n\nconsole.log(raspberryPiInfo.detect());\n```\n\n## Contributing\n\nPull requests are always welcomed.\n\n## With ❤️ by Alex Kratky\n\n[Contact webpage](https://alexkratky.com/)¨\n","readmeFilename":"README.md"}