{"name":"node-machine-id","version":"1.1.12","main":"./dist/index.js","types":"./types/index.d.ts","description":"Unique machine (desktop) id (no admin privileges required).","author":{"name":"Aleksandr Komlev"},"license":"MIT","repository":{"type":"git","url":"git+ssh://git@github.com/automation-stack/node-machine-id.git"},"keywords":["unique id","license","trial","user license","user id","machine id","unique platform id","node platform id","unique identifier","restrictions","electron id","nw.js id"],"bugs":{"url":"https://github.com/automation-stack/node-machine-id/issues"},"homepage":"https://github.com/automation-stack/node-machine-id#readme","scripts":{"build":"WEBPACK=node_modules/webpack/bin/webpack.js && $WEBPACK --config webpack.config.babel.js","prepublish":"npm run test","lint":"node_modules/eslint/bin/eslint.js -c .eslintrc ./src","test":"node_modules/mocha/bin/mocha --compilers js:babel-core/register ./tests"},"devDependencies":{"babel-cli":"^6.18.0","babel-core":"^6.21.0","babel-eslint":"^7.1.1","babel-loader":"^6.2.4","babel-plugin-array-includes":"^2.0.3","babel-plugin-lodash":"^2.2.1","babel-plugin-module-resolver":"^2.4.0","babel-plugin-syntax-async-functions":"^6.5.0","babel-plugin-syntax-decorators":"^6.5.0","babel-plugin-syntax-flow":"^6.8.0","babel-plugin-syntax-object-rest-spread":"^6.5.0","babel-plugin-transform-async-to-module-method":"^6.7.0","babel-plugin-transform-class-properties":"^6.6.0","babel-plugin-transform-decorators-legacy":"^1.3.4","babel-plugin-transform-flow-strip-types":"^6.8.0","babel-plugin-transform-regenerator":"^6.6.5","babel-plugin-transform-runtime":"^6.6.0","babel-polyfill":"^6.7.2","babel-preset-es2015":"^6.6.0","babel-preset-stage-0":"^6.5.0","babel-runtime":"^6.6.1","bundlesize":"^0.6.1","chai":"^3.5.0","copy-webpack-plugin":"^1.1.1","eslint":"^2.6.0","eslint-loader":"^1.3.0","eslint-plugin-babel":"^3.2.0","eslint-plugin-flowtype":"^2.3.0","estraverse-fb":"^1.3.1","html-webpack-plugin":"^2.10.0","json-loader":"^0.5.4","mocha":"^2.4.5","raw-loader":"^0.5.1","source-map-support":"^0.4.0","webpack":"1.14.0"},"gitHead":"bb012fcf92ed3afd2f9b3b393f58a6ccf6744a3b","_id":"node-machine-id@1.1.12","_nodeVersion":"10.15.3","_npmVersion":"6.9.0","dist":{"integrity":"sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==","shasum":"37904eee1e59b320bb9c5d6c0a59f3b469cb6267","tarball":"http://registry-npm.ywwl.com/node-machine-id/download/node-machine-id-1.1.12.tgz","fileCount":12,"unpackedSize":35771,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJc7qJrCRA9TVsSAnZWagAAqrUP/3UUjzLd2pdm0gTd4Sap\nS0G3+fSOtkMo3zMfSOXgh1YZP+M7ywhItB3PI3poOVNDz+KHTf3kmbItzui7\nW56tEU3cMQwyFQlbOc9NnQAbHRZFt4lodcgD4ABhJPLZnMQGi0cmqXCz8Sec\nMFHhPuumQej6MdRnPN92NchlwMZO+wYctH4xOTeZnRHVEo1PNp0AriUqQYef\nrRl6/+VH/90vqdklLfkQtrQU3I38XslO3d8tkQO6DhbeORxuMt41XSQLoXFn\nsFP/1CYWu3uS1xmMXOyC8IGPaAfhICSdWBRyZzaoaphef01fKPsgA9jczr3/\n/y8dzZYjLUj5j34/KC6FCIpxUMCGWjgzvVM3T1g9C/6n6nbDF2zphXhN2oWK\nv3iGNmfQEaj7O2XgkeTIQfdjotFawuwhOsWliiP+lrcf1c9+LXOyK8bxEFgt\n+kvkw55Gg1fHDd/VQje19akgOgaUEsB0oa7qrC+hgtVQeXGUtRju53hThrgz\nuhahbaOLMQfLZTMTjYniZDApcjg17w97JlDsw6drWXiqVebTQDrJlYEVNanX\nrt7ZqlV+SUzV8HbZNcGCmsk3isvXf1R65tWxpLSM4/pjGWITVBqy3EqRHyVd\nATOrejLwZuXQckQB9db9RDwTMwWh1FZBHKfufPYf+ZTko7At/gjibEf5JhMT\nAfyd\r\n=WgVF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC36UgPq/9KMMVX4+NN358LG+/xF6A5pUwav+muhcG0AAiEA0uHu46yZi78/8Oah6Hm1YnJt3zIMnioIl9mRkaYHr0w="}],"size":13067,"noattachment":false,"key":"/node-machine-id/-/node-machine-id-1.1.12.tgz"},"maintainers":[{"name":"automation-stack","email":"aleksandr.komlev@gmail.com"}],"_npmUser":{"name":"automation-stack","email":"aleksandr.komlev@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/node-machine-id_1.1.12_1559143018426_0.34099145848276136"},"_hasShrinkwrap":false,"readme":"**Cross-platform unique machine (desktop) id discovery**\n\n\n## Use cases\n- Software restrictions\n- Installation tracking\n\n## Features\n- Hardware independent\n- Unique within the OS installation\n- No elevated rights required\n- No external dependencies and does not require any native bindings\n- Cross-platform (OSx, Win, Linux)\n\n## How it works\n\nModule based on OS native UUID/GUID which used for internal needs.\n\n**All others approaches requires elevated rights or much depends on hardware components, but this approach summarize the methods of selecting the most reliable unique identifier**\n\n- **Win32/64** uses key ```MachineGuid``` in registry\n```HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography``` **(can be changed by administrator but with unpredictable consequences)**\n>   It is generated during OS installation and won't change unless you make another OS\n>   updates or reinstall. Depending on the OS version it may contain the network adapter\n>   MAC address embedded (plus some other numbers, including random), or a pseudorandom number.\n\n- **OSx** uses ```IOPlatformUUID``` (the same Hardware UUID)\n``` ioreg -rd1 -c IOPlatformExpertDevice ```\n>   Value from I/O Kit registry in IOPlatformExpertDevice class\n\n- **Linux** uses ```/var/lib/dbus/machine-id``` **(can be changed by ```root``` but with unpredictable consequences)**\nhttp://man7.org/linux/man-pages/man5/machine-id.5.html\n>   The /var/lib/dbus/machine-id file contains the unique machine ID of the local\n>   system that is set during installation. The machine ID is a single\n>   newline-terminated, hexadecimal, 32-character, lowercase machine ID\n>   string. When decoded from hexadecimal, this corresponds with a\n>   16-byte/128-bit string.\n>\n>   The machine ID is usually generated from a random source during\n>   system installation and stays constant for all subsequent boots.\n>   Optionally, for stateless systems, it is generated during runtime at\n>   early boot if it is found to be empty.\n>\n>   The machine ID does not change based on user configuration or when\n>   hardware is replaced.\n\n\n## Installation\n```\nnpm install node-machine-id\n```\n\n## Usage\n### Function: machineId(original)\n- **original** ```<Boolean>```, If ```true``` return original value of machine id, otherwise return hashed value (sha-256), default: ```false```\n\n### Function: machineIdSync(original);\n- syncronous version of ```machineId```\n\n```js\nimport {machineId, machineIdSync} from 'node-machine-id';\n\n// Asyncronous call with async/await or Promise\n\nasync function getMachineId() {\n    let id = await machineId();\n    ...\n}\n\nmachineId().then((id) => {\n    ...\n})\n\n// Syncronous call\n\nlet id = machineIdSync()\n// id = c24b0fe51856497eebb6a2bfcd120247aac0d6334d670bb92e09a00ce8169365\nlet id = machineIdSync({original: true})\n// id = 98912984-c4e9-5ceb-8000-03882a0485e4\n```\n### Caveats\n\n- Image-based environments have usually the same `machine-id`\n> As a workaround you can generate new machine-ids for each instance (or container) with `dbus-uuidgen` and changed them in the respective > files: `/etc/machine-id` and `/var/lib/dbus/machine-id`. Thanks [@stefanhuber](https://github.com/stefanhuber)\n","publish_time":1559143018577,"_cnpm_publish_time":1559143018577,"dist-tags":{"latest":"1.1.12"}}