node-unique-machine-id
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

node-unique-machine-id

Get the unique machine id (cross-platform, without admin privileges)

Installation

npm install node-unique-machine-id

Usage

import { machineId, machineIdSync } from 'node-unique-machine-id';
 
// or async... await...
machineId().then(id => {
  console.log(id);
  //=> e7da09af80e39cd1b2af442ce529f90d5f607ed626a31e869ac48c6a6148b4a3
});
 
const id = machineIdSync(true);
console.log(id);
//=> 98912984-c4e9-5ceb-8000-03882a0485e4

API

machineId(original?:boolean, fallthrough?: boolean)

machineIdSync(original?:boolean, fallthrough?: boolean)

original: default: false. If true return original value of machine id, otherwise return hashed value (sha-256)

fallthrough: default: false. If true, uuid will be generated and saved when there is an error in obtaining (use for Unsupported platforms)

Thanks

Readme

Keywords

none

Package Sidebar

Install

npm i node-unique-machine-id

Weekly Downloads

822

Version

1.1.0

License

MIT

Unpacked Size

6.38 kB

Total Files

5

Last publish

Collaborators

  • zenghongtu