Skip to content

Commit

Permalink
fix: use native os module to get os platform
Browse files Browse the repository at this point in the history
  • Loading branch information
jooy2 committed May 2, 2024
1 parent 0858455 commit 2e2f5cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ The UUID may change when the system is reinstalled or as the virtual machine's e

This method returns the same value for every user on the system.


```javascript
console.log(await machineId()); // a642d9e1-6063-4da7-8ea8-2298f989d01d
```
Expand Down
3 changes: 2 additions & 1 deletion lib/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { platform } from 'os';
import { exec as processExec } from 'child_process';

export default class Machini {
static machineId(): Promise<string> {
return new Promise((resolve, reject) => {
const platformName = process.platform;
const platformName = platform();
let execCommands = '';

if (platformName === 'win32') {
Expand Down

0 comments on commit 2e2f5cc

Please sign in to comment.