{"_id":"@0biwank/gethwid","_rev":"8-cabbcc0af86e5a2db3f1c270b52bd571","name":"@0biwank/gethwid","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@0biwank/gethwid","version":"1.0.0","keywords":["hwid","hardware-id","node-addon","napi","native-addon","system-info"],"author":{"name":"Kunal Dubey"},"license":"MIT","_id":"@0biwank/gethwid@1.0.0","maintainers":[{"name":"0biwank","email":"kunaldubeyseven@gmail.com"}],"homepage":"https://github.com/0biwank/getHWID#readme","bugs":{"url":"https://github.com/0biwank/getHWID/issues"},"os":["win32"],"dist":{"shasum":"55e3bdacf1005306efcb643ad39c7f8a6408b66c","tarball":"https://registry.npmjs.org/@0biwank/gethwid/-/gethwid-1.0.0.tgz","fileCount":5,"integrity":"sha512-cWf39egUR7nUIPrhe2VYwUuapO40+VR0nSqNitmkPbs8V5r491FLnLvgTjP5r6pF88vl3dx2zJ8SEiHUrHyyOQ==","signatures":[{"sig":"MEYCIQCp1WY2Y5DawVPxm4gso7UOFSop2+SZnAjoF+2X9PsacAIhAJqG95O7OfMMfUi5Oq93uTpQ/J8lprJKUCE+jjwoHHpd","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":281804},"main":"index.js","type":"module","types":"./index.d.ts","engines":{"node":">=14.0.0"},"gitHead":"e04774227439a2e1ccf320797b7a7ac360157bc9","gypfile":true,"scripts":{"test":"node test.js","build":"node-gyp configure build","install":"node-gyp rebuild","rebuild":"node-gyp rebuild"},"_npmUser":{"name":"0biwank","email":"kunaldubeyseven@gmail.com"},"repository":{"url":"git+https://github.com/0biwank/getHWID.git","type":"git"},"_npmVersion":"10.1.0","description":"Get Hardware ID (HWID) of the machine using a native Node.js addon built with N-API.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"node-addon-api":"^8.5.0"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^11.4.2"},"_npmOperationalInternal":{"tmp":"tmp/gethwid_1.0.0_1764846690860_0.015528033111922745","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@0biwank/gethwid","version":"1.0.2","keywords":["hwid","hardware-id","node-addon","napi","native-addon","system-info"],"author":{"name":"Kunal Dubey"},"license":"MIT","_id":"@0biwank/gethwid@1.0.2","maintainers":[{"name":"0biwank","email":"kunaldubeyseven@gmail.com"}],"homepage":"https://github.com/0biwank/getHWID#readme","bugs":{"url":"https://github.com/0biwank/getHWID/issues"},"os":["win32"],"dist":{"shasum":"a3c7416d404a61e6232c1a50c916fcb25212e251","tarball":"https://registry.npmjs.org/@0biwank/gethwid/-/gethwid-1.0.2.tgz","fileCount":6,"integrity":"sha512-s+IFOM/AH9mgXh/fwEBSPWUQbpo3E9YXd4HTheS+AwK3SkWPRL5M/OdI1++5M6dt77rGc+pdazKCLN7dapuVcg==","signatures":[{"sig":"MEQCIAGp0sFoqEArJk0LavNA5VTNyAXrxEzmbH35j4oPHxDjAiBpNKmCJqzawm0XqOSUJ1weNvPqqDFdH72KJTyS47FWdw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":282269},"main":"index.js","type":"module","types":"./index.d.ts","engines":{"node":">=14.0.0"},"gitHead":"e04774227439a2e1ccf320797b7a7ac360157bc9","gypfile":true,"scripts":{"test":"node test.js","build":"node-gyp configure build","install":"node-gyp rebuild","rebuild":"node-gyp rebuild"},"_npmUser":{"name":"0biwank","email":"kunaldubeyseven@gmail.com"},"repository":{"url":"git+https://github.com/0biwank/getHWID.git","type":"git"},"_npmVersion":"10.1.0","description":"Get Hardware ID (HWID) of the machine using a native Node.js addon built with N-API.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"node-addon-api":"^8.5.0"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^11.4.2"},"_npmOperationalInternal":{"tmp":"tmp/gethwid_1.0.2_1764855331498_0.5078363741232677","host":"s3://npm-registry-packages-npm-production"}},"1.0.3":{"name":"@0biwank/gethwid","version":"1.0.3","keywords":["hwid","hardware-id","node-addon","napi","native-addon","system-info"],"author":{"name":"Kunal Dubey"},"license":"MIT","_id":"@0biwank/gethwid@1.0.3","maintainers":[{"name":"0biwank","email":"kunaldubeyseven@gmail.com"}],"homepage":"https://github.com/0biwank/getHWID#readme","bugs":{"url":"https://github.com/0biwank/getHWID/issues"},"os":["win32"],"dist":{"shasum":"c48fda43214da15c00993c87f618e2f453ce8408","tarball":"https://registry.npmjs.org/@0biwank/gethwid/-/gethwid-1.0.3.tgz","fileCount":6,"integrity":"sha512-TCBCAO7JeBbWT9liGhKQi5myiP+gpPvmm19iR2w25RhBtpIkzQ+17ciMr5sJLnBr1It/fBH41NP8uwkCayvF1g==","signatures":[{"sig":"MEUCIQD4I9Wy3muCZ2/izc6jriiNXbtgAoHHPU1ymaBsHDFzkgIgUjuO+UIaBwGaK0+S6wIDfIemxHBFy1JtCkSKTEMHsAg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":152734},"main":"index.js","type":"module","types":"./index.d.ts","engines":{"node":">=14.0.0"},"gitHead":"7bb34ea77285de79bcd503647007ce7e42ca448f","gypfile":true,"scripts":{"test":"node test.js","build":"node-gyp configure build","install":"node-gyp rebuild","rebuild":"node-gyp rebuild"},"_npmUser":{"name":"0biwank","email":"kunaldubeyseven@gmail.com"},"repository":{"url":"git+https://github.com/0biwank/getHWID.git","type":"git"},"_npmVersion":"10.1.0","description":"Get Hardware ID (HWID) of the machine using a native Node.js addon built with N-API.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"node-addon-api":"^8.5.0"},"_hasShrinkwrap":false,"devDependencies":{"node-gyp":"^11.4.2"},"_npmOperationalInternal":{"tmp":"tmp/gethwid_1.0.3_1766077435944_0.7714883118651417","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2025-12-04T11:11:30.752Z","modified":"2026-06-22T05:25:38.370Z","1.0.1":"2025-12-04T10:55:44.550Z","0.0.1":"2025-12-04T11:07:18.880Z","1.0.0":"2025-12-04T11:11:31.043Z","1.0.2":"2025-12-04T13:35:31.683Z","1.0.3":"2025-12-18T17:03:56.129Z"},"bugs":{"url":"https://github.com/0biwank/getHWID/issues"},"author":{"name":"Kunal Dubey"},"license":"MIT","homepage":"https://github.com/0biwank/getHWID#readme","keywords":["hwid","hardware-id","node-addon","napi","native-addon","system-info"],"repository":{"url":"git+https://github.com/0biwank/getHWID.git","type":"git"},"description":"Get Hardware ID (HWID) of the machine using a native Node.js addon built with N-API.","maintainers":[{"email":"kunaldubeyseven@gmail.com","name":"0biwan-ops"}],"readme":"# getHWID\r\n\r\nA native Node.js module for retrieving hardware identification information on Windows systems. This module uses N-API to access Windows WMI (Windows Management Instrumentation) and system firmware data.\r\n\r\n## Features\r\n\r\n- CPU Serial: Get the processor ID from CPU\r\n- Disk Serial: Retrieve the serial number of physical storage devices\r\n- Motherboard Serial: Fetch motherboard serial number\r\n- MAC Address: Get the network adapter's MAC address\r\n- Built with N-API for native access\r\n- Includes TypeScript definitions\r\n\r\n## Requirements\r\n\r\n- **Node.js**: >= 14.0.0\r\n- **Platform**: Windows (Win32) only\r\n- **Build Tools**: Python 3.x and C++ compiler (for building from source)\r\n\r\n## Installation\r\n\r\n```bash\r\nnpm install @0biwank/gethwid\r\n```\r\n\r\n## Usage\r\n\r\n### JavaScript (ESM)\r\n\r\n```javascript\r\nimport { getCPUSerial, getDiskSerial, getMotherboardSerial, getMacAddress } from '@0biwank/gethwid';\r\n\r\n// Get CPU Serial\r\nconst cpuSerial = getCPUSerial();\r\nconsole.log('CPU Serial:', cpuSerial);\r\n\r\n// Get Disk Serial\r\nconst diskSerial = getDiskSerial();\r\nconsole.log('Disk Serial:', diskSerial);\r\n\r\n// Get Motherboard Serial\r\nconst mbSerial = getMotherboardSerial();\r\nconsole.log('Motherboard Serial:', mbSerial);\r\n\r\n// Get MAC Address\r\nconst macAddress = getMacAddress();\r\nconsole.log('MAC Address:', macAddress);\r\n```\r\n\r\n### JavaScript (CommonJS with default export)\r\n\r\n```javascript\r\nimport getHWID from '@0biwank/gethwid';\r\n\r\nconst cpu = getHWID.getCPUSerial();\r\nconst disk = getHWID.getDiskSerial();\r\nconst mb = getHWID.getMotherboardSerial();\r\nconst mac = getHWID.getMacAddress();\r\n\r\nconsole.log({ cpu, disk, mb, mac });\r\n```\r\n\r\n### TypeScript\r\n\r\n```typescript\r\nimport { getCPUSerial, getDiskSerial, getMotherboardSerial, getMacAddress } from '@0biwank/gethwid';\r\n\r\nconst cpuSerial: string = getCPUSerial();\r\nconst diskSerial: string = getDiskSerial();\r\nconst mbSerial: string = getMotherboardSerial();\r\nconst macAddress: string = getMacAddress();\r\n\r\nconsole.log({\r\n  cpu: cpuSerial,\r\n  disk: diskSerial,\r\n  motherboard: mbSerial,\r\n  mac: macAddress\r\n});\r\n```\r\n\r\n## API Reference\r\n\r\n### `getCPUSerial(): string`\r\n\r\nReturns the processor ID from the CPU.\r\n\r\n**Returns**: A string containing the CPU processor ID.\r\n\r\n**Example**:\r\n```javascript\r\nconst cpu = getCPUSerial();\r\n```\r\n\r\n### `getDiskSerial(): string`\r\n\r\nReturns the serial number of the primary physical disk/storage device.\r\n\r\n**Returns**: A string containing the disk serial number.\r\n\r\n**Example**:\r\n```javascript\r\nconst disk = getDiskSerial();\r\n```\r\n\r\n### `getMotherboardSerial(): string`\r\n\r\nReturns the serial number of the motherboard/baseboard.\r\n\r\n**Returns**: A string containing the motherboard serial number.\r\n\r\n**Example**:\r\n```javascript\r\nconst mb = getMotherboardSerial();\r\n```\r\n\r\n### `getMacAddress(): string`\r\n\r\nReturns the MAC (Media Access Control) address of the primary network adapter.\r\n\r\n**Returns**: A string containing the MAC address in standard notation (XX:XX:XX:XX:XX:XX).\r\n\r\n**Example**:\r\n```javascript\r\nconst mac = getMacAddress();\r\n```\r\n\r\n## How It Works\r\n\r\nThis module uses:\r\n\r\n1. **Windows WMI (Windows Management Instrumentation)** for CPU, disk, and motherboard information\r\n2. **System Firmware Table** (via `GetSystemFirmwareTable`) for system UUID and detailed hardware info\r\n3. **N-API** for seamless integration between Node.js and native C++ code\r\n\r\n## Building from Source\r\n\r\nIf you need to rebuild the module:\r\n\r\n```bash\r\n# Install dependencies\r\nnpm install\r\n\r\n# Rebuild the native addon\r\nnpm run rebuild\r\n```\r\n\r\n### Prerequisites for Building\r\n\r\n- **Node.js** with development headers\r\n- **Python 3.x**\r\n- **Microsoft Visual Studio** (Community Edition is sufficient) with C++ workload\r\n\r\n## Testing\r\n\r\nRun the test suite:\r\n\r\n```bash\r\nnpm test\r\n```\r\n\r\nThis will execute `test.js` and display hardware information for your system.\r\n\r\n## Limitations\r\n\r\n- Windows Only: This module only works on Windows systems (Win32)\r\n- Administrator Privileges: Some information may require elevated privileges\r\n- Virtual Machines: Virtualized environments may return virtual hardware identifiers\r\n- Dual Boot: Only detects hardware of the current Windows installation\r\n\r\n## Error Handling\r\n\r\nFunctions return empty strings if hardware information cannot be retrieved:\r\n\r\n```javascript\r\nconst cpuSerial = getCPUSerial();\r\n\r\nif (!cpuSerial) {\r\n  console.warn('Could not retrieve CPU serial');\r\n} else {\r\n  console.log('CPU:', cpuSerial);\r\n}\r\n```\r\n\r\n## Performance\r\n\r\nAll functions execute synchronously and typically complete quickly by accessing system information through WMI queries.\r\n\r\n## License\r\n\r\nMIT © [Kunal Dubey](https://github.com/0biwank)\r\n\r\n## Repository\r\n\r\n[GitHub: 0biwank/getHWID](https://github.com/0biwank/getHWID)\r\n\r\n## Contributing\r\n\r\nContributions and bug reports are welcome. Please open an issue or submit a pull request on GitHub.\r\n\r\n## Disclaimer\r\n\r\nThis module retrieves hardware identification information for legitimate purposes such as:\r\n- System administration\r\n- License key generation\r\n- Device identification for software activation\r\n- Hardware inventory management\r\n\r\nUsers are responsible for complying with applicable laws and privacy regulations when using hardware identification data.","readmeFilename":"README.md"}