native-machine-id 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bin/machine-id.js +0 -0
- package/dist/index.js +2 -3
- package/dist/index.js.map +1 -1
- package/package.json +12 -9
- package/dist/debug.d.ts +0 -6
- package/dist/debug.d.ts.map +0 -1
- package/dist/debug.js +0 -44
- package/dist/debug.js.map +0 -1
package/dist/bin/machine-id.js
CHANGED
|
File without changes
|
package/dist/index.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.getMachineId = getMachineId;
|
|
7
|
+
exports.getMachineIdSync = getMachineIdSync;
|
|
7
8
|
const bindings_1 = __importDefault(require("bindings"));
|
|
8
9
|
const crypto_1 = require("crypto");
|
|
9
10
|
const util_1 = require("util");
|
|
@@ -32,7 +33,6 @@ async function getMachineId({ raw = false, } = {}) {
|
|
|
32
33
|
}
|
|
33
34
|
return (0, crypto_1.createHash)('sha256').update(machineId).digest('hex');
|
|
34
35
|
}
|
|
35
|
-
exports.getMachineId = getMachineId;
|
|
36
36
|
function getMachineIdSync({ raw = false } = {}) {
|
|
37
37
|
const machineId = getMachineIdFromBindingSync();
|
|
38
38
|
if (!machineId || raw === true) {
|
|
@@ -40,5 +40,4 @@ function getMachineIdSync({ raw = false } = {}) {
|
|
|
40
40
|
}
|
|
41
41
|
return (0, crypto_1.createHash)('sha256').update(machineId).digest('hex');
|
|
42
42
|
}
|
|
43
|
-
exports.getMachineIdSync = getMachineIdSync;
|
|
44
43
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"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QAAQ,CAAC,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "native-machine-id",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Native retrieval of a unique desktop machine ID without admin privileges or child processes. Faster and more reliable alternative to node-machine-id.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -25,9 +25,11 @@
|
|
|
25
25
|
},
|
|
26
26
|
"license": "Apache-2.0",
|
|
27
27
|
"exports": {
|
|
28
|
-
"
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
".": {
|
|
29
|
+
"require": "./dist/index.js",
|
|
30
|
+
"import": "./dist/.esm-wrapper.mjs",
|
|
31
|
+
"types": "./dist/index.d.ts"
|
|
32
|
+
}
|
|
31
33
|
},
|
|
32
34
|
"homepage": "https://github.com/mongodb-js/devtools-shared",
|
|
33
35
|
"repository": {
|
|
@@ -51,15 +53,15 @@
|
|
|
51
53
|
"@mongodb-js/tsconfig-devtools": "^1.0.3",
|
|
52
54
|
"@types/chai": "^4.2.21",
|
|
53
55
|
"@types/mocha": "^9.1.1",
|
|
54
|
-
"@types/sinon-chai": "^3.2.5",
|
|
55
56
|
"@types/node": "^17.0.35",
|
|
57
|
+
"@types/sinon-chai": "^3.2.5",
|
|
58
|
+
"chai": "^4.5.0",
|
|
56
59
|
"eslint": "^7.25.0",
|
|
57
60
|
"gen-esm-wrapper": "^1.1.1",
|
|
58
61
|
"mocha": "^8.4.0",
|
|
59
|
-
"chai": "^4.5.0",
|
|
60
62
|
"node-machine-id": "^1.1.12",
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
+
"ts-node": "^10.9.2",
|
|
64
|
+
"typescript": "^5.0.4"
|
|
63
65
|
},
|
|
64
66
|
"keywords": [
|
|
65
67
|
"machine id",
|
|
@@ -78,5 +80,6 @@
|
|
|
78
80
|
"native",
|
|
79
81
|
"telemetry",
|
|
80
82
|
"telemetry id"
|
|
81
|
-
]
|
|
83
|
+
],
|
|
84
|
+
"gitHead": "702894cb6455e6055830c2b6c8bb1be3365bdd7b"
|
|
82
85
|
}
|
package/dist/debug.d.ts
DELETED
package/dist/debug.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":"AAeA,QAAA,MAAM,SAAS,EAAE,GAAY,CAAC;AAY9B,QAAA,MAAM,UAAU;;;GAoBf,CAAC"}
|
package/dist/debug.js
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
console.log('Node.js version:', process.version);
|
|
3
|
-
console.log('Process type:', process.type || 'standard node');
|
|
4
|
-
console.log('Electron:', process.versions.electron || 'not running in Electron');
|
|
5
|
-
const globalAny = global;
|
|
6
|
-
console.log('BoxedNode features detected:', {
|
|
7
|
-
hasBoxednodeConfig: typeof globalAny.__boxednode_config !== 'undefined',
|
|
8
|
-
hasBoxednodeRequireMapper: typeof globalAny.__boxednode_require_mapper !== 'undefined',
|
|
9
|
-
hasOriginalRequire: typeof globalAny.__original_require !== 'undefined',
|
|
10
|
-
});
|
|
11
|
-
console.log('Module paths:', module.paths);
|
|
12
|
-
const approaches = [
|
|
13
|
-
{ name: 'Standard require', fn: () => require('native_machine_id.node') },
|
|
14
|
-
{ name: 'Bindings', fn: () => require('bindings')('native_machine_id') },
|
|
15
|
-
{
|
|
16
|
-
name: 'Relative path',
|
|
17
|
-
fn: () => require('../build/Release/native_machine_id.node'),
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
name: 'Dynamic path',
|
|
21
|
-
fn: () => require(require('path').join(__dirname, '..', 'build', 'Release', 'native_machine_id.node')),
|
|
22
|
-
},
|
|
23
|
-
];
|
|
24
|
-
for (const approach of approaches) {
|
|
25
|
-
try {
|
|
26
|
-
const result = approach.fn();
|
|
27
|
-
console.log(`✅ ${approach.name} succeeded:`, {
|
|
28
|
-
hasMachineIdSync: typeof result.getMachineIdSync === 'function',
|
|
29
|
-
hasMachineIdAsync: typeof result.getMachineIdAsync === 'function',
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
catch (error) {
|
|
33
|
-
console.error(`❌ ${approach.name} failed:`, error.message);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
try {
|
|
37
|
-
const { getMachineIdSync } = require('../dist/index.js');
|
|
38
|
-
const id = getMachineIdSync();
|
|
39
|
-
console.log('✅ getMachineIdSync returned:', id ? `${id.substring(0, 8)}...` : 'undefined');
|
|
40
|
-
}
|
|
41
|
-
catch (error) {
|
|
42
|
-
console.error('❌ getMachineIdSync failed:', error.message);
|
|
43
|
-
}
|
|
44
|
-
//# sourceMappingURL=debug.js.map
|
package/dist/debug.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../src/debug.ts"],"names":[],"mappings":";AAOA,OAAO,CAAC,GAAG,CAAC,kBAAkB,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;AACjD,OAAO,CAAC,GAAG,CAAC,eAAe,EAAE,OAAO,CAAC,IAAI,IAAI,eAAe,CAAC,CAAC;AAC9D,OAAO,CAAC,GAAG,CACT,WAAW,EACX,OAAO,CAAC,QAAQ,CAAC,QAAQ,IAAI,yBAAyB,CACvD,CAAC;AAGF,MAAM,SAAS,GAAQ,MAAM,CAAC;AAC9B,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE;IAC1C,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,KAAK,WAAW;IACvE,yBAAyB,EACvB,OAAO,SAAS,CAAC,0BAA0B,KAAK,WAAW;IAC7D,kBAAkB,EAAE,OAAO,SAAS,CAAC,kBAAkB,KAAK,WAAW;CACxE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